2700 if (is_system_labeled()) {
2701 clabel = req->rq_label;
2702 ASSERT(clabel != NULL);
2703 DTRACE_PROBE2(tx__rfs3__log__info__oprename__clabel, char *,
2704 "got client label from request(1)", struct svc_req *, req);
2705
2706 if (!blequal(&l_admin_low->tsl_label, clabel)) {
2707 if (!do_rfs_label_check(clabel, fvp, EQUALITY_CHECK,
2708 exi)) {
2709 resp->status = NFS3ERR_ACCES;
2710 goto err1;
2711 }
2712 }
2713 }
2714
2715 fbva.va_mask = AT_ALL;
2716 fbvap = VOP_GETATTR(fvp, &fbva, 0, cr, NULL) ? NULL : &fbva;
2717 favap = fbvap;
2718
2719 fh3 = &args->to.dir;
2720 to_exi = checkexport(&fh3->fh3_fsid, FH3TOXFIDP(fh3));
2721 if (to_exi == NULL) {
2722 resp->status = NFS3ERR_ACCES;
2723 goto err1;
2724 }
2725 exi_rele(to_exi);
2726
2727 if (to_exi != exi) {
2728 resp->status = NFS3ERR_XDEV;
2729 goto err1;
2730 }
2731
2732 tvp = nfs3_fhtovp(&args->to.dir, exi);
2733 if (tvp == NULL) {
2734 error = ESTALE;
2735 goto err;
2736 }
2737
2738 tbva.va_mask = AT_ALL;
2739 tbvap = VOP_GETATTR(tvp, &tbva, 0, cr, NULL) ? NULL : &tbva;
2740 tavap = tbvap;
2910
2911 vap = NULL;
2912 bvap = NULL;
2913 avap = NULL;
2914 dvp = NULL;
2915
2916 vp = nfs3_fhtovp(&args->file, exi);
2917
2918 DTRACE_NFSV3_4(op__link__start, struct svc_req *, req,
2919 cred_t *, cr, vnode_t *, vp, LINK3args *, args);
2920
2921 if (vp == NULL) {
2922 error = ESTALE;
2923 goto out;
2924 }
2925
2926 va.va_mask = AT_ALL;
2927 vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
2928
2929 fh3 = &args->link.dir;
2930 to_exi = checkexport(&fh3->fh3_fsid, FH3TOXFIDP(fh3));
2931 if (to_exi == NULL) {
2932 resp->status = NFS3ERR_ACCES;
2933 goto out1;
2934 }
2935 exi_rele(to_exi);
2936
2937 if (to_exi != exi) {
2938 resp->status = NFS3ERR_XDEV;
2939 goto out1;
2940 }
2941
2942 if (is_system_labeled()) {
2943 clabel = req->rq_label;
2944
2945 ASSERT(clabel != NULL);
2946 DTRACE_PROBE2(tx__rfs3__log__info__oplink__clabel, char *,
2947 "got client label from request(1)", struct svc_req *, req);
2948
2949 if (!blequal(&l_admin_low->tsl_label, clabel)) {
2950 if (!do_rfs_label_check(clabel, vp, DOMINANCE_CHECK,
|
2700 if (is_system_labeled()) {
2701 clabel = req->rq_label;
2702 ASSERT(clabel != NULL);
2703 DTRACE_PROBE2(tx__rfs3__log__info__oprename__clabel, char *,
2704 "got client label from request(1)", struct svc_req *, req);
2705
2706 if (!blequal(&l_admin_low->tsl_label, clabel)) {
2707 if (!do_rfs_label_check(clabel, fvp, EQUALITY_CHECK,
2708 exi)) {
2709 resp->status = NFS3ERR_ACCES;
2710 goto err1;
2711 }
2712 }
2713 }
2714
2715 fbva.va_mask = AT_ALL;
2716 fbvap = VOP_GETATTR(fvp, &fbva, 0, cr, NULL) ? NULL : &fbva;
2717 favap = fbvap;
2718
2719 fh3 = &args->to.dir;
2720 to_exi = checkexport(&fh3->fh3_fsid, FH3TOXFIDP(fh3), NULL);
2721 if (to_exi == NULL) {
2722 resp->status = NFS3ERR_ACCES;
2723 goto err1;
2724 }
2725 exi_rele(to_exi);
2726
2727 if (to_exi != exi) {
2728 resp->status = NFS3ERR_XDEV;
2729 goto err1;
2730 }
2731
2732 tvp = nfs3_fhtovp(&args->to.dir, exi);
2733 if (tvp == NULL) {
2734 error = ESTALE;
2735 goto err;
2736 }
2737
2738 tbva.va_mask = AT_ALL;
2739 tbvap = VOP_GETATTR(tvp, &tbva, 0, cr, NULL) ? NULL : &tbva;
2740 tavap = tbvap;
2910
2911 vap = NULL;
2912 bvap = NULL;
2913 avap = NULL;
2914 dvp = NULL;
2915
2916 vp = nfs3_fhtovp(&args->file, exi);
2917
2918 DTRACE_NFSV3_4(op__link__start, struct svc_req *, req,
2919 cred_t *, cr, vnode_t *, vp, LINK3args *, args);
2920
2921 if (vp == NULL) {
2922 error = ESTALE;
2923 goto out;
2924 }
2925
2926 va.va_mask = AT_ALL;
2927 vap = VOP_GETATTR(vp, &va, 0, cr, NULL) ? NULL : &va;
2928
2929 fh3 = &args->link.dir;
2930 to_exi = checkexport(&fh3->fh3_fsid, FH3TOXFIDP(fh3), NULL);
2931 if (to_exi == NULL) {
2932 resp->status = NFS3ERR_ACCES;
2933 goto out1;
2934 }
2935 exi_rele(to_exi);
2936
2937 if (to_exi != exi) {
2938 resp->status = NFS3ERR_XDEV;
2939 goto out1;
2940 }
2941
2942 if (is_system_labeled()) {
2943 clabel = req->rq_label;
2944
2945 ASSERT(clabel != NULL);
2946 DTRACE_PROBE2(tx__rfs3__log__info__oplink__clabel, char *,
2947 "got client label from request(1)", struct svc_req *, req);
2948
2949 if (!blequal(&l_admin_low->tsl_label, clabel)) {
2950 if (!do_rfs_label_check(clabel, vp, DOMINANCE_CHECK,
|