summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs3xdr.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-03-23 02:25:38 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-03-23 02:25:38 +0000
commit16b5d462f73eb29d1f67fa01cc1ea66afdc72569 (patch)
tree5407bd573f4840e473ea27cbe61e5c7a07131fcd /fs/nfsd/nfs3xdr.c
parentce8a076e11e7e5ee36007f9a3eee5bb3744cb8f6 (diff)
Merge with Linux 2.3.99-pre2.
Diffstat (limited to 'fs/nfsd/nfs3xdr.c')
-rw-r--r--fs/nfsd/nfs3xdr.c39
1 files changed, 27 insertions, 12 deletions
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index 7dc5739eb..6e102db9c 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -727,25 +727,40 @@ encode_entry(struct readdir_cd *cd, const char *name,
/* throw in readdirplus baggage */
if (plus) {
struct svc_fh fh;
+ struct svc_export *exp;
+ struct dentry *dparent, *dchild;
+
+ dparent = cd->dirfh->fh_dentry;
+ exp = cd->dirfh->fh_export;
fh_init(&fh, NFS3_FHSIZE);
- /* Disabled for now because of lock-up */
- if (0 && nfsd_lookup(cd->rqstp, cd->dirfh, name, namlen, &fh) == 0) {
- p = encode_post_op_attr(cd->rqstp, p, fh.fh_dentry);
- p = encode_fh(p, &fh);
- fh_put(&fh);
- } else {
- /* Didn't find this entry... weird.
- * Proceed without the attrs anf fh anyway.
- */
- *p++ = 0;
- *p++ = 0;
- }
+ if (fh_verify(cd->rqstp, cd->dirfh, S_IFDIR, MAY_EXEC) != 0)
+ goto noexec;
+ if (isdotent(name, namlen)) {
+ dchild = dparent;
+ if (namlen == 2)
+ dchild = dchild->d_parent;
+ dchild = dget(dchild);
+ } else
+ dchild = lookup_one(name, dget(dparent));
+ if (IS_ERR(dchild))
+ goto noexec;
+ if (fh_compose(&fh, exp, dchild) != 0 || !dchild->d_inode)
+ goto noexec;
+ p = encode_post_op_attr(cd->rqstp, p, fh.fh_dentry);
+ p = encode_fh(p, &fh);
+ fh_put(&fh);
}
+out:
cd->buflen = buflen;
cd->buffer = p;
return 0;
+
+noexec:
+ *p++ = 0;
+ *p++ = 0;
+ goto out;
}
int