Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46076
b: refs/heads/master
c: faebf4e
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Feb 3, 2007
1 parent c8401bc commit 317d1f3
Show file tree
Hide file tree
Showing 2 changed files with 7 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: c79ba787c11e767ffaf8d723923afda99ba6c63c
refs/heads/master: faebf4e2bb0efad9dda396ea13d5c6ad15d7d7fb
11 changes: 6 additions & 5 deletions trunk/fs/nfs/getroot.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,15 @@ int nfs4_path_walk(struct nfs_server *server,
struct nfs_fh lastfh;
struct qstr name;
int ret;
//int referral_count = 0;

dprintk("--> nfs4_path_walk(,,%s)\n", path);

fsinfo.fattr = &fattr;
nfs_fattr_init(&fattr);

if (*path++ != '/') {
dprintk("nfs4_get_root: Path does not begin with a slash\n");
return -EINVAL;
}
/* Eat leading slashes */
while (*path == '/')
path++;

/* Start by getting the root filehandle from the server */
ret = server->nfs_client->rpc_ops->getroot(server, mntfh, &fsinfo);
Expand All @@ -160,6 +158,7 @@ int nfs4_path_walk(struct nfs_server *server,
return -ENOTDIR;
}

/* FIXME: It is quite valid for the server to return a referral here */
if (fattr.valid & NFS_ATTR_FATTR_V4_REFERRAL) {
printk(KERN_ERR "nfs4_get_root:"
" getroot obtained referral\n");
Expand Down Expand Up @@ -187,6 +186,7 @@ int nfs4_path_walk(struct nfs_server *server,
goto eat_dot_dir;
}

/* FIXME: Why shouldn't the user be able to use ".." in the path? */
if (path[0] == '.' && path[1] == '.' && (path[2] == '/' || !path[2])
) {
printk(KERN_ERR "nfs4_get_root:"
Expand All @@ -212,6 +212,7 @@ int nfs4_path_walk(struct nfs_server *server,
return -ENOTDIR;
}

/* FIXME: Referrals are quite valid here too */
if (fattr.valid & NFS_ATTR_FATTR_V4_REFERRAL) {
printk(KERN_ERR "nfs4_get_root:"
" lookupfh obtained referral\n");
Expand Down

0 comments on commit 317d1f3

Please sign in to comment.