aboutsummaryrefslogtreecommitdiffstats
path: root/fs/affs/super.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-02-07 19:20:16 -0500
committerEric W. Biederman <ebiederm@xmission.com>2012-09-21 06:13:30 -0400
commit8fed10be0029acda5564f03b9cc1fc4cb7470bae (patch)
tree56adb124ae1f6e23a7de3c8d2e41419c5ba8d2a7 /fs/affs/super.c
parentf31389d50817c9a99c3ea81fbb2e3789e303cfe8 (diff)
userns: Convert affs to use kuid/kgid wherwe appropriate
Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'fs/affs/super.c')
-rw-r--r--fs/affs/super.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/affs/super.c b/fs/affs/super.c
index c70f1e5fc024..966c8c06b9b3 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -188,7 +188,7 @@ static const match_table_t tokens = {
188}; 188};
189 189
190static int 190static int
191parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s32 *root, 191parse_options(char *options, kuid_t *uid, kgid_t *gid, int *mode, int *reserved, s32 *root,
192 int *blocksize, char **prefix, char *volume, unsigned long *mount_opts) 192 int *blocksize, char **prefix, char *volume, unsigned long *mount_opts)
193{ 193{
194 char *p; 194 char *p;
@@ -253,13 +253,17 @@ parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s
253 case Opt_setgid: 253 case Opt_setgid:
254 if (match_int(&args[0], &option)) 254 if (match_int(&args[0], &option))
255 return 0; 255 return 0;
256 *gid = option; 256 *gid = make_kgid(current_user_ns(), option);
257 if (!gid_valid(*gid))
258 return 0;
257 *mount_opts |= SF_SETGID; 259 *mount_opts |= SF_SETGID;
258 break; 260 break;
259 case Opt_setuid: 261 case Opt_setuid:
260 if (match_int(&args[0], &option)) 262 if (match_int(&args[0], &option))
261 return 0; 263 return 0;
262 *uid = option; 264 *uid = make_kuid(current_user_ns(), option);
265 if (!uid_valid(*uid))
266 return 0;
263 *mount_opts |= SF_SETUID; 267 *mount_opts |= SF_SETUID;
264 break; 268 break;
265 case Opt_verbose: 269 case Opt_verbose:
@@ -301,8 +305,8 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
301 int num_bm; 305 int num_bm;
302 int i, j; 306 int i, j;
303 s32 key; 307 s32 key;
304 uid_t uid; 308 kuid_t uid;
305 gid_t gid; 309 kgid_t gid;
306 int reserved; 310 int reserved;
307 unsigned long mount_flags; 311 unsigned long mount_flags;
308 int tmp_flags; /* fix remount prototype... */ 312 int tmp_flags; /* fix remount prototype... */
@@ -527,8 +531,8 @@ affs_remount(struct super_block *sb, int *flags, char *data)
527{ 531{
528 struct affs_sb_info *sbi = AFFS_SB(sb); 532 struct affs_sb_info *sbi = AFFS_SB(sb);
529 int blocksize; 533 int blocksize;
530 uid_t uid; 534 kuid_t uid;
531 gid_t gid; 535 kgid_t gid;
532 int mode; 536 int mode;
533 int reserved; 537 int reserved;
534 int root_block; 538 int root_block;