fs/9p: Pass the correct user credentials during attach
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Tue, 1 Jun 2010 09:26:18 +0000 (09:26 +0000)
committerEric Van Hensbergen <ericvh@gmail.com>
Mon, 2 Aug 2010 19:25:08 +0000 (14:25 -0500)
We need to make sure we pass the right uid value
during attach. dotl is similar to dotu in this regard.
Without this mapped security model on dotl doesn't work

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
fs/9p/fid.c
fs/9p/v9fs.c

index 7317b39b28159b2e712de1eec7bed5fce2312b3a..5d6cfcbf73e7623488f88cffd5bd4fc7f178dd22 100644 (file)
@@ -152,7 +152,8 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
                        if (access == V9FS_ACCESS_SINGLE)
                                return ERR_PTR(-EPERM);
 
-                       if (v9fs_proto_dotu(v9ses))
+                       if (v9fs_proto_dotu(v9ses) ||
+                               v9fs_proto_dotl(v9ses))
                                uname = NULL;
                        else
                                uname = v9ses->uname;
index f8b86e92cd660ef9da7e026be6a06fb7de4863fb..3c492011221ce11e1b1d40d08775ddd9edcc8352 100644 (file)
@@ -278,7 +278,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
        v9ses->maxdata = v9ses->clnt->msize - P9_IOHDRSZ;
 
        /* for legacy mode, fall back to V9FS_ACCESS_ANY */
-       if (!v9fs_proto_dotu(v9ses) &&
+       if (!(v9fs_proto_dotu(v9ses) || v9fs_proto_dotl(v9ses)) &&
                ((v9ses->flags&V9FS_ACCESS_MASK) == V9FS_ACCESS_USER)) {
 
                v9ses->flags &= ~V9FS_ACCESS_MASK;