diff options
Diffstat (limited to 'fs/hfsplus/options.c')
-rw-r--r-- | fs/hfsplus/options.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/hfsplus/options.c b/fs/hfsplus/options.c index 06fa5618600c..ed257c671615 100644 --- a/fs/hfsplus/options.c +++ b/fs/hfsplus/options.c | |||
@@ -135,14 +135,22 @@ int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi) | |||
135 | printk(KERN_ERR "hfs: uid requires an argument\n"); | 135 | printk(KERN_ERR "hfs: uid requires an argument\n"); |
136 | return 0; | 136 | return 0; |
137 | } | 137 | } |
138 | sbi->uid = (uid_t)tmp; | 138 | sbi->uid = make_kuid(current_user_ns(), (uid_t)tmp); |
139 | if (!uid_valid(sbi->uid)) { | ||
140 | printk(KERN_ERR "hfs: invalid uid specified\n"); | ||
141 | return 0; | ||
142 | } | ||
139 | break; | 143 | break; |
140 | case opt_gid: | 144 | case opt_gid: |
141 | if (match_int(&args[0], &tmp)) { | 145 | if (match_int(&args[0], &tmp)) { |
142 | printk(KERN_ERR "hfs: gid requires an argument\n"); | 146 | printk(KERN_ERR "hfs: gid requires an argument\n"); |
143 | return 0; | 147 | return 0; |
144 | } | 148 | } |
145 | sbi->gid = (gid_t)tmp; | 149 | sbi->gid = make_kgid(current_user_ns(), (gid_t)tmp); |
150 | if (!gid_valid(sbi->gid)) { | ||
151 | printk(KERN_ERR "hfs: invalid gid specified\n"); | ||
152 | return 0; | ||
153 | } | ||
146 | break; | 154 | break; |
147 | case opt_part: | 155 | case opt_part: |
148 | if (match_int(&args[0], &sbi->part)) { | 156 | if (match_int(&args[0], &sbi->part)) { |
@@ -215,7 +223,8 @@ int hfsplus_show_options(struct seq_file *seq, struct dentry *root) | |||
215 | if (sbi->type != HFSPLUS_DEF_CR_TYPE) | 223 | if (sbi->type != HFSPLUS_DEF_CR_TYPE) |
216 | seq_printf(seq, ",type=%.4s", (char *)&sbi->type); | 224 | seq_printf(seq, ",type=%.4s", (char *)&sbi->type); |
217 | seq_printf(seq, ",umask=%o,uid=%u,gid=%u", sbi->umask, | 225 | seq_printf(seq, ",umask=%o,uid=%u,gid=%u", sbi->umask, |
218 | sbi->uid, sbi->gid); | 226 | from_kuid_munged(&init_user_ns, sbi->uid), |
227 | from_kgid_munged(&init_user_ns, sbi->gid)); | ||
219 | if (sbi->part >= 0) | 228 | if (sbi->part >= 0) |
220 | seq_printf(seq, ",part=%u", sbi->part); | 229 | seq_printf(seq, ",part=%u", sbi->part); |
221 | if (sbi->session >= 0) | 230 | if (sbi->session >= 0) |