Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327243
b: refs/heads/master
c: 7dc0588
h: refs/heads/master
i:
  327241: acac5d5
  327239: 5f38bfc
v: v3
  • Loading branch information
Eric W. Biederman committed Sep 7, 2012
1 parent e740cc3 commit f07feda
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 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: c9235f4872e810d43bf1b19b92cdbe0ec282bada
refs/heads/master: 7dc05881b64792e0ea41293e9595cc962a716225
26 changes: 18 additions & 8 deletions trunk/fs/debugfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ static inline int debugfs_positive(struct dentry *dentry)
}

struct debugfs_mount_opts {
uid_t uid;
gid_t gid;
kuid_t uid;
kgid_t gid;
umode_t mode;
};

Expand All @@ -156,6 +156,8 @@ static int debugfs_parse_options(char *data, struct debugfs_mount_opts *opts)
substring_t args[MAX_OPT_ARGS];
int option;
int token;
kuid_t uid;
kgid_t gid;
char *p;

opts->mode = DEBUGFS_DEFAULT_MODE;
Expand All @@ -169,12 +171,18 @@ static int debugfs_parse_options(char *data, struct debugfs_mount_opts *opts)
case Opt_uid:
if (match_int(&args[0], &option))
return -EINVAL;
opts->uid = option;
uid = make_kuid(current_user_ns(), option);
if (!uid_valid(uid))
return -EINVAL;
opts->uid = uid;
break;
case Opt_gid:
if (match_octal(&args[0], &option))
return -EINVAL;
opts->gid = option;
gid = make_kgid(current_user_ns(), option);
if (!gid_valid(gid))
return -EINVAL;
opts->gid = gid;
break;
case Opt_mode:
if (match_octal(&args[0], &option))
Expand Down Expand Up @@ -226,10 +234,12 @@ static int debugfs_show_options(struct seq_file *m, struct dentry *root)
struct debugfs_fs_info *fsi = root->d_sb->s_fs_info;
struct debugfs_mount_opts *opts = &fsi->mount_opts;

if (opts->uid != 0)
seq_printf(m, ",uid=%u", opts->uid);
if (opts->gid != 0)
seq_printf(m, ",gid=%u", opts->gid);
if (!uid_eq(opts->uid, GLOBAL_ROOT_UID))
seq_printf(m, ",uid=%u",
from_kuid_munged(&init_user_ns, opts->uid));
if (!gid_eq(opts->gid, GLOBAL_ROOT_GID))
seq_printf(m, ",gid=%u",
from_kgid_munged(&init_user_ns, opts->gid));
if (opts->mode != DEBUGFS_DEFAULT_MODE)
seq_printf(m, ",mode=%o", opts->mode);

Expand Down
1 change: 0 additions & 1 deletion trunk/init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,6 @@ config UIDGID_CONVERTED
depends on CODA_FS = n
depends on CONFIGFS_FS = n
depends on CRAMFS = n
depends on DEBUG_FS = n
depends on ECRYPT_FS = n
depends on EFS_FS = n
depends on EXOFS_FS = n
Expand Down

0 comments on commit f07feda

Please sign in to comment.