Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164628
b: refs/heads/master
c: 2671a4b
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and J. Bruce Fields committed Sep 3, 2009
1 parent 588efdf commit 8bb75d6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bc6c53d5a1383d5d9632adf33bd03458cfc0869d
refs/heads/master: 2671a4bf3516757ca028c139a7902a50f2bd994a
2 changes: 2 additions & 0 deletions trunk/fs/nfsd/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,8 @@ exp_pseudoroot(struct svc_rqst *rqstp, struct svc_fh *fhp)
if (rv)
goto out;
rv = check_nfsd_access(exp, rqstp);
if (rv)
fh_put(fhp);
out:
exp_put(exp);
return rv;
Expand Down
15 changes: 10 additions & 5 deletions trunk/fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1599,7 +1599,8 @@ static __be32 nfsd4_encode_fs_location4(struct nfsd4_fs_location *location,
static char *nfsd4_path(struct svc_rqst *rqstp, struct svc_export *exp, __be32 *stat)
{
struct svc_fh tmp_fh;
char *path, *rootpath;
char *path = NULL, *rootpath;
size_t rootlen;

fh_init(&tmp_fh, NFS4_FHSIZE);
*stat = exp_pseudoroot(rqstp, &tmp_fh);
Expand All @@ -1609,14 +1610,18 @@ static char *nfsd4_path(struct svc_rqst *rqstp, struct svc_export *exp, __be32 *

path = exp->ex_pathname;

if (strncmp(path, rootpath, strlen(rootpath))) {
rootlen = strlen(rootpath);
if (strncmp(path, rootpath, rootlen)) {
dprintk("nfsd: fs_locations failed;"
"%s is not contained in %s\n", path, rootpath);
*stat = nfserr_notsupp;
return NULL;
path = NULL;
goto out;
}

return path + strlen(rootpath);
path += rootlen;
out:
fh_put(&tmp_fh);
return path;
}

/*
Expand Down

0 comments on commit 8bb75d6

Please sign in to comment.