diff options
Diffstat (limited to 'fs/hfs/super.c')
-rw-r--r-- | fs/hfs/super.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/hfs/super.c b/fs/hfs/super.c index 4eb873e0c07b..0b63d135a092 100644 --- a/fs/hfs/super.c +++ b/fs/hfs/super.c | |||
@@ -138,7 +138,9 @@ static int hfs_show_options(struct seq_file *seq, struct dentry *root) | |||
138 | seq_printf(seq, ",creator=%.4s", (char *)&sbi->s_creator); | 138 | seq_printf(seq, ",creator=%.4s", (char *)&sbi->s_creator); |
139 | if (sbi->s_type != cpu_to_be32(0x3f3f3f3f)) | 139 | if (sbi->s_type != cpu_to_be32(0x3f3f3f3f)) |
140 | seq_printf(seq, ",type=%.4s", (char *)&sbi->s_type); | 140 | seq_printf(seq, ",type=%.4s", (char *)&sbi->s_type); |
141 | seq_printf(seq, ",uid=%u,gid=%u", sbi->s_uid, sbi->s_gid); | 141 | seq_printf(seq, ",uid=%u,gid=%u", |
142 | from_kuid_munged(&init_user_ns, sbi->s_uid), | ||
143 | from_kgid_munged(&init_user_ns, sbi->s_gid)); | ||
142 | if (sbi->s_file_umask != 0133) | 144 | if (sbi->s_file_umask != 0133) |
143 | seq_printf(seq, ",file_umask=%o", sbi->s_file_umask); | 145 | seq_printf(seq, ",file_umask=%o", sbi->s_file_umask); |
144 | if (sbi->s_dir_umask != 0022) | 146 | if (sbi->s_dir_umask != 0022) |
@@ -254,14 +256,22 @@ static int parse_options(char *options, struct hfs_sb_info *hsb) | |||
254 | printk(KERN_ERR "hfs: uid requires an argument\n"); | 256 | printk(KERN_ERR "hfs: uid requires an argument\n"); |
255 | return 0; | 257 | return 0; |
256 | } | 258 | } |
257 | hsb->s_uid = (uid_t)tmp; | 259 | hsb->s_uid = make_kuid(current_user_ns(), (uid_t)tmp); |
260 | if (!uid_valid(hsb->s_uid)) { | ||
261 | printk(KERN_ERR "hfs: invalid uid %d\n", tmp); | ||
262 | return 0; | ||
263 | } | ||
258 | break; | 264 | break; |
259 | case opt_gid: | 265 | case opt_gid: |
260 | if (match_int(&args[0], &tmp)) { | 266 | if (match_int(&args[0], &tmp)) { |
261 | printk(KERN_ERR "hfs: gid requires an argument\n"); | 267 | printk(KERN_ERR "hfs: gid requires an argument\n"); |
262 | return 0; | 268 | return 0; |
263 | } | 269 | } |
264 | hsb->s_gid = (gid_t)tmp; | 270 | hsb->s_gid = make_kgid(current_user_ns(), (gid_t)tmp); |
271 | if (!gid_valid(hsb->s_gid)) { | ||
272 | printk(KERN_ERR "hfs: invalid gid %d\n", tmp); | ||
273 | return 0; | ||
274 | } | ||
265 | break; | 275 | break; |
266 | case opt_umask: | 276 | case opt_umask: |
267 | if (match_octal(&args[0], &tmp)) { | 277 | if (match_octal(&args[0], &tmp)) { |