diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-02-10 14:35:50 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-09-21 06:13:12 -0400 |
commit | ba64e2b9e368fbe588ed5e3bb1494cc1dc4664a4 (patch) | |
tree | 0651712f5b75e584b52570ad6cb6bc26b0b9523c /fs/isofs | |
parent | 16525e3f146fbba1ae43740c7d3895d4f396a768 (diff) |
userns: Convert isofs to use kuid/kgid where appropriate
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'fs/isofs')
-rw-r--r-- | fs/isofs/inode.c | 17 | ||||
-rw-r--r-- | fs/isofs/isofs.h | 4 | ||||
-rw-r--r-- | fs/isofs/rock.c | 4 |
3 files changed, 15 insertions, 10 deletions
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 29037c365ba4..a7d8e6cc5e0c 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/cdrom.h> | 21 | #include <linux/cdrom.h> |
22 | #include <linux/parser.h> | 22 | #include <linux/parser.h> |
23 | #include <linux/mpage.h> | 23 | #include <linux/mpage.h> |
24 | #include <linux/user_namespace.h> | ||
24 | 25 | ||
25 | #include "isofs.h" | 26 | #include "isofs.h" |
26 | #include "zisofs.h" | 27 | #include "zisofs.h" |
@@ -171,8 +172,8 @@ struct iso9660_options{ | |||
171 | unsigned int blocksize; | 172 | unsigned int blocksize; |
172 | umode_t fmode; | 173 | umode_t fmode; |
173 | umode_t dmode; | 174 | umode_t dmode; |
174 | gid_t gid; | 175 | kgid_t gid; |
175 | uid_t uid; | 176 | kuid_t uid; |
176 | char *iocharset; | 177 | char *iocharset; |
177 | /* LVE */ | 178 | /* LVE */ |
178 | s32 session; | 179 | s32 session; |
@@ -383,8 +384,8 @@ static int parse_options(char *options, struct iso9660_options *popt) | |||
383 | popt->fmode = popt->dmode = ISOFS_INVALID_MODE; | 384 | popt->fmode = popt->dmode = ISOFS_INVALID_MODE; |
384 | popt->uid_set = 0; | 385 | popt->uid_set = 0; |
385 | popt->gid_set = 0; | 386 | popt->gid_set = 0; |
386 | popt->gid = 0; | 387 | popt->gid = GLOBAL_ROOT_GID; |
387 | popt->uid = 0; | 388 | popt->uid = GLOBAL_ROOT_UID; |
388 | popt->iocharset = NULL; | 389 | popt->iocharset = NULL; |
389 | popt->utf8 = 0; | 390 | popt->utf8 = 0; |
390 | popt->overriderockperm = 0; | 391 | popt->overriderockperm = 0; |
@@ -460,13 +461,17 @@ static int parse_options(char *options, struct iso9660_options *popt) | |||
460 | case Opt_uid: | 461 | case Opt_uid: |
461 | if (match_int(&args[0], &option)) | 462 | if (match_int(&args[0], &option)) |
462 | return 0; | 463 | return 0; |
463 | popt->uid = option; | 464 | popt->uid = make_kuid(current_user_ns(), option); |
465 | if (!uid_valid(popt->uid)) | ||
466 | return 0; | ||
464 | popt->uid_set = 1; | 467 | popt->uid_set = 1; |
465 | break; | 468 | break; |
466 | case Opt_gid: | 469 | case Opt_gid: |
467 | if (match_int(&args[0], &option)) | 470 | if (match_int(&args[0], &option)) |
468 | return 0; | 471 | return 0; |
469 | popt->gid = option; | 472 | popt->gid = make_kgid(current_user_ns(), option); |
473 | if (!gid_valid(popt->gid)) | ||
474 | return 0; | ||
470 | popt->gid_set = 1; | 475 | popt->gid_set = 1; |
471 | break; | 476 | break; |
472 | case Opt_mode: | 477 | case Opt_mode: |
diff --git a/fs/isofs/isofs.h b/fs/isofs/isofs.h index 3620ad1ea9bc..99167238518d 100644 --- a/fs/isofs/isofs.h +++ b/fs/isofs/isofs.h | |||
@@ -52,8 +52,8 @@ struct isofs_sb_info { | |||
52 | 52 | ||
53 | umode_t s_fmode; | 53 | umode_t s_fmode; |
54 | umode_t s_dmode; | 54 | umode_t s_dmode; |
55 | gid_t s_gid; | 55 | kgid_t s_gid; |
56 | uid_t s_uid; | 56 | kuid_t s_uid; |
57 | struct nls_table *s_nls_iocharset; /* Native language support table */ | 57 | struct nls_table *s_nls_iocharset; /* Native language support table */ |
58 | }; | 58 | }; |
59 | 59 | ||
diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c index 70e79d0c756a..c0bf42472e40 100644 --- a/fs/isofs/rock.c +++ b/fs/isofs/rock.c | |||
@@ -364,8 +364,8 @@ repeat: | |||
364 | case SIG('P', 'X'): | 364 | case SIG('P', 'X'): |
365 | inode->i_mode = isonum_733(rr->u.PX.mode); | 365 | inode->i_mode = isonum_733(rr->u.PX.mode); |
366 | set_nlink(inode, isonum_733(rr->u.PX.n_links)); | 366 | set_nlink(inode, isonum_733(rr->u.PX.n_links)); |
367 | inode->i_uid = isonum_733(rr->u.PX.uid); | 367 | i_uid_write(inode, isonum_733(rr->u.PX.uid)); |
368 | inode->i_gid = isonum_733(rr->u.PX.gid); | 368 | i_gid_write(inode, isonum_733(rr->u.PX.gid)); |
369 | break; | 369 | break; |
370 | case SIG('P', 'N'): | 370 | case SIG('P', 'N'): |
371 | { | 371 | { |