@@ -121,6 +121,7 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
switch (access) {
case V9FS_ACCESS_SINGLE:
case V9FS_ACCESS_USER:
+ case V9FS_ACCESS_CLIENT:
uid = current_fsuid();
any = 0;
break;
@@ -193,6 +193,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
v9ses->flags |= V9FS_ACCESS_USER;
else if (strcmp(s, "any") == 0)
v9ses->flags |= V9FS_ACCESS_ANY;
+ else if (strcmp(s, "client") == 0)
+ v9ses->flags |= V9FS_ACCESS_CLIENT;
else {
v9ses->flags |= V9FS_ACCESS_SINGLE;
v9ses->uid = simple_strtoul(s, &e, 10);
@@ -279,7 +281,8 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
/* for legacy mode, fall back to V9FS_ACCESS_ANY */
if (!(v9fs_proto_dotu(v9ses) || v9fs_proto_dotl(v9ses)) &&
- ((v9ses->flags&V9FS_ACCESS_MASK) == V9FS_ACCESS_USER)) {
+ (((v9ses->flags&V9FS_ACCESS_MASK) == V9FS_ACCESS_USER) ||
+ ((v9ses->flags&V9FS_ACCESS_MASK) == V9FS_ACCESS_CLIENT))) {
v9ses->flags &= ~V9FS_ACCESS_MASK;
v9ses->flags |= V9FS_ACCESS_ANY;
@@ -29,6 +29,7 @@
* @V9FS_ACCESS_SINGLE: only the mounting user can access the hierarchy
* @V9FS_ACCESS_USER: a new attach will be issued for every user (default)
* @V9FS_ACCESS_ANY: use a single attach for all users
+ * @V9FS_ACCESS_CLIENT: Like V9FS_ACCESS_USER, but access check on client.
* @V9FS_ACCESS_MASK: bit mask of different ACCESS options
*
* Session flags reflect options selected by users at mount time
@@ -39,7 +40,8 @@ enum p9_session_flags {
V9FS_ACCESS_SINGLE = 0x04,
V9FS_ACCESS_USER = 0x08,
V9FS_ACCESS_ANY = 0x0C,
- V9FS_ACCESS_MASK = 0x0C,
+ V9FS_ACCESS_CLIENT = 0x14,
+ V9FS_ACCESS_MASK = 0x1C,
};
/* possible values of ->cache */