Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104099
b: refs/heads/master
c: 496d6c3
h: refs/heads/master
i:
  104097: bfbc247
  104095: 613a9a0
v: v3
  • Loading branch information
Neil Brown authored and J. Bruce Fields committed Jun 30, 2008
1 parent 5feddc3 commit e7198fd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 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: 863a24882ed0a57ff25daaf39885f3a47b706e4b
refs/heads/master: 496d6c32d4d057cb44272d9bd587ff97d023ee92
29 changes: 26 additions & 3 deletions trunk/fs/nfsd/nfsfh.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,24 @@ static __be32 nfsd_set_fh_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp)
if (IS_ERR(exp))
return nfserrno(PTR_ERR(exp));

error = nfsd_setuser_and_check_port(rqstp, exp);
if (error)
goto out;
if (exp->ex_flags & NFSEXP_NOSUBTREECHECK) {
/* Elevate privileges so that the lack of 'r' or 'x'
* permission on some parent directory will
* not stop exportfs_decode_fh from being able
* to reconnect a directory into the dentry cache.
* The same problem can affect "SUBTREECHECK" exports,
* but as nfsd_acceptable depends on correct
* access control settings being in effect, we cannot
* fix that case easily.
*/
current->cap_effective =
cap_raise_nfsd_set(current->cap_effective,
current->cap_permitted);
} else {
error = nfsd_setuser_and_check_port(rqstp, exp);
if (error)
goto out;
}

/*
* Look up the dentry using the NFS file handle.
Expand Down Expand Up @@ -215,6 +230,14 @@ static __be32 nfsd_set_fh_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp)
goto out;
}

if (exp->ex_flags & NFSEXP_NOSUBTREECHECK) {
error = nfsd_setuser_and_check_port(rqstp, exp);
if (error) {
dput(dentry);
goto out;
}
}

if (S_ISDIR(dentry->d_inode->i_mode) &&
(dentry->d_flags & DCACHE_DISCONNECTED)) {
printk("nfsd: find_fh_dentry returned a DISCONNECTED directory: %s/%s\n",
Expand Down

0 comments on commit e7198fd

Please sign in to comment.