]> err.no Git - linux-2.6/blobdiff - fs/nfsd/nfsfh.c
Merge branch 'isdn-fix' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6
[linux-2.6] / fs / nfsd / nfsfh.c
index 89f9041a77825bfcd7c2195101d2d9bee46cc0f4..0eb464a39aaeb502e0614569ff81208e3226b120 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/svc.h>
+#include <linux/sunrpc/svcauth_gss.h>
 #include <linux/nfsd/nfsd.h>
 
 #define NFSDDBG_FACILITY               NFSDDBG_FH
@@ -120,8 +121,6 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
                int data_left = fh->fh_size/4;
 
                error = nfserr_stale;
-               if (rqstp->rq_client == NULL)
-                       goto out;
                if (rqstp->rq_vers > 2)
                        error = nfserr_badhandle;
                if (rqstp->rq_vers == 4 && fh->fh_size == 0)
@@ -145,7 +144,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
                                fh->fh_fsid[1] = fh->fh_fsid[2];
                        }
                        if ((data_left -= len)<0) goto out;
-                       exp = exp_find(rqstp->rq_client, fh->fh_fsid_type, datap, &rqstp->rq_chandle);
+                       exp = rqst_exp_find(rqstp, fh->fh_fsid_type, datap);
                        datap += len;
                } else {
                        dev_t xdev;
@@ -156,8 +155,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
                        xdev = old_decode_dev(fh->ofh_xdev);
                        xino = u32_to_ino_t(fh->ofh_xino);
                        mk_fsid(FSID_DEV, tfh, xdev, xino, 0, NULL);
-                       exp = exp_find(rqstp->rq_client, FSID_DEV, tfh,
-                                      &rqstp->rq_chandle);
+                       exp = rqst_exp_find(rqstp, FSID_DEV, tfh);
                }
 
                error = nfserr_stale;
@@ -251,8 +249,19 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
        if (error)
                goto out;
 
+       if (!(access & MAY_LOCK)) {
+               /*
+                * pseudoflavor restrictions are not enforced on NLM,
+                * which clients virtually always use auth_sys for,
+                * even while using RPCSEC_GSS for NFS.
+                */
+               error = check_nfsd_access(exp, rqstp);
+               if (error)
+                       goto out;
+       }
+
        /* Finally, check access permissions. */
-       error = nfsd_permission(exp, dentry, access);
+       error = nfsd_permission(rqstp, exp, dentry, access);
 
        if (error) {
                dprintk("fh_verify: %s/%s permission failure, "