Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327276
b: refs/heads/master
c: b9b73f7
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman committed Sep 21, 2012
1 parent b78e56d commit ec4cbf8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 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: 32d639c66e04149d490093f8b4b49cb922bfe294
refs/heads/master: b9b73f7c4d45d69289aa16620b04430068dd3941
23 changes: 16 additions & 7 deletions trunk/drivers/usb/gadget/f_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ struct ffs_data {
/* File permissions, written once when fs is mounted */
struct ffs_file_perms {
umode_t mode;
uid_t uid;
gid_t gid;
kuid_t uid;
kgid_t gid;
} file_perms;

/*
Expand Down Expand Up @@ -1143,10 +1143,19 @@ static int ffs_fs_parse_opts(struct ffs_sb_fill_data *data, char *opts)
break;

case 3:
if (!memcmp(opts, "uid", 3))
data->perms.uid = value;
if (!memcmp(opts, "uid", 3)) {
data->perms.uid = make_kuid(current_user_ns(), value);
if (!uid_valid(data->perms.uid)) {
pr_err("%s: unmapped value: %lu\n", opts, value);
return -EINVAL;
}
}
else if (!memcmp(opts, "gid", 3))
data->perms.gid = value;
data->perms.gid = make_kgid(current_user_ns(), value);
if (!gid_valid(data->perms.gid)) {
pr_err("%s: unmapped value: %lu\n", opts, value);
return -EINVAL;
}
else
goto invalid;
break;
Expand Down Expand Up @@ -1175,8 +1184,8 @@ ffs_fs_mount(struct file_system_type *t, int flags,
struct ffs_sb_fill_data data = {
.perms = {
.mode = S_IFREG | 0600,
.uid = 0,
.gid = 0
.uid = GLOBAL_ROOT_UID,
.gid = GLOBAL_ROOT_GID,
},
.root_mode = S_IFDIR | 0500,
};
Expand Down
1 change: 0 additions & 1 deletion trunk/init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,6 @@ config UIDGID_CONVERTED
depends on NET_9P = n

# Filesystems
depends on USB_FUNCTIONFS = n
depends on DEVTMPFS = n
depends on XENFS = n

Expand Down

0 comments on commit ec4cbf8

Please sign in to comment.