summaryrefslogtreecommitdiffstats
path: root/fs/affs/super.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-02-07 16:20:16 -0800
committerEric W. Biederman <ebiederm@xmission.com>2012-09-21 03:13:30 -0700
commit8fed10be0029acda5564f03b9cc1fc4cb7470bae (patch)
tree56adb124ae1f6e23a7de3c8d2e41419c5ba8d2a7 /fs/affs/super.c
parentf31389d50817c9a99c3ea81fbb2e3789e303cfe8 (diff)
downloadlinux-8fed10be0029acda5564f03b9cc1fc4cb7470bae.tar.gz
linux-8fed10be0029acda5564f03b9cc1fc4cb7470bae.tar.bz2
linux-8fed10be0029acda5564f03b9cc1fc4cb7470bae.zip
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 = {
};
static int
-parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s32 *root,
+parse_options(char *options, kuid_t *uid, kgid_t *gid, int *mode, int *reserved, s32 *root,
int *blocksize, char **prefix, char *volume, unsigned long *mount_opts)
{
char *p;
@@ -253,13 +253,17 @@ parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s
case Opt_setgid:
if (match_int(&args[0], &option))
return 0;
- *gid = option;
+ *gid = make_kgid(current_user_ns(), option);
+ if (!gid_valid(*gid))
+ return 0;
*mount_opts |= SF_SETGID;
break;
case Opt_setuid:
if (match_int(&args[0], &option))
return 0;
- *uid = option;
+ *uid = make_kuid(current_user_ns(), option);
+ if (!uid_valid(*uid))
+ return 0;
*mount_opts |= SF_SETUID;
break;
case Opt_verbose:
@@ -301,8 +305,8 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
int num_bm;
int i, j;
s32 key;
- uid_t uid;
- gid_t gid;
+ kuid_t uid;
+ kgid_t gid;
int reserved;
unsigned long mount_flags;
int tmp_flags; /* fix remount prototype... */
@@ -527,8 +531,8 @@ affs_remount(struct super_block *sb, int *flags, char *data)
{
struct affs_sb_info *sbi = AFFS_SB(sb);
int blocksize;
- uid_t uid;
- gid_t gid;
+ kuid_t uid;
+ kgid_t gid;
int mode;
int reserved;
int root_block;