diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-02-07 18:50:56 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-09-21 06:13:36 -0400 |
commit | 39241beb78f69925b0475ad78f06f0e0589fb71b (patch) | |
tree | 526bdb9a4235b6a2dda6553855de9480af06f78d /fs/ubifs | |
parent | 61293ee2749bc2414725da37e50308154ff91574 (diff) |
userns: Convert ubifs to use kuid/kgid
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/budget.c | 4 | ||||
-rw-r--r-- | fs/ubifs/debug.c | 4 | ||||
-rw-r--r-- | fs/ubifs/journal.c | 4 | ||||
-rw-r--r-- | fs/ubifs/sb.c | 4 | ||||
-rw-r--r-- | fs/ubifs/super.c | 4 | ||||
-rw-r--r-- | fs/ubifs/ubifs.h | 4 |
6 files changed, 12 insertions, 12 deletions
diff --git a/fs/ubifs/budget.c b/fs/ubifs/budget.c index bc4f94b28706..969489e478bc 100644 --- a/fs/ubifs/budget.c +++ b/fs/ubifs/budget.c | |||
@@ -272,8 +272,8 @@ long long ubifs_calc_available(const struct ubifs_info *c, int min_idx_lebs) | |||
272 | */ | 272 | */ |
273 | static int can_use_rp(struct ubifs_info *c) | 273 | static int can_use_rp(struct ubifs_info *c) |
274 | { | 274 | { |
275 | if (current_fsuid() == c->rp_uid || capable(CAP_SYS_RESOURCE) || | 275 | if (uid_eq(current_fsuid(), c->rp_uid) || capable(CAP_SYS_RESOURCE) || |
276 | (c->rp_gid != 0 && in_group_p(c->rp_gid))) | 276 | (!gid_eq(c->rp_gid, GLOBAL_ROOT_GID) && in_group_p(c->rp_gid))) |
277 | return 1; | 277 | return 1; |
278 | return 0; | 278 | return 0; |
279 | } | 279 | } |
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index bb3167257aab..340d1afc1302 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c | |||
@@ -243,8 +243,8 @@ void ubifs_dump_inode(struct ubifs_info *c, const struct inode *inode) | |||
243 | printk(KERN_ERR "\tsize %llu\n", | 243 | printk(KERN_ERR "\tsize %llu\n", |
244 | (unsigned long long)i_size_read(inode)); | 244 | (unsigned long long)i_size_read(inode)); |
245 | printk(KERN_ERR "\tnlink %u\n", inode->i_nlink); | 245 | printk(KERN_ERR "\tnlink %u\n", inode->i_nlink); |
246 | printk(KERN_ERR "\tuid %u\n", (unsigned int)inode->i_uid); | 246 | printk(KERN_ERR "\tuid %u\n", (unsigned int)i_uid_read(inode)); |
247 | printk(KERN_ERR "\tgid %u\n", (unsigned int)inode->i_gid); | 247 | printk(KERN_ERR "\tgid %u\n", (unsigned int)i_gid_read(inode)); |
248 | printk(KERN_ERR "\tatime %u.%u\n", | 248 | printk(KERN_ERR "\tatime %u.%u\n", |
249 | (unsigned int)inode->i_atime.tv_sec, | 249 | (unsigned int)inode->i_atime.tv_sec, |
250 | (unsigned int)inode->i_atime.tv_nsec); | 250 | (unsigned int)inode->i_atime.tv_nsec); |
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index 12c0f154ca83..afaad07f3b29 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c | |||
@@ -469,8 +469,8 @@ static void pack_inode(struct ubifs_info *c, struct ubifs_ino_node *ino, | |||
469 | ino->ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); | 469 | ino->ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); |
470 | ino->mtime_sec = cpu_to_le64(inode->i_mtime.tv_sec); | 470 | ino->mtime_sec = cpu_to_le64(inode->i_mtime.tv_sec); |
471 | ino->mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); | 471 | ino->mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); |
472 | ino->uid = cpu_to_le32(inode->i_uid); | 472 | ino->uid = cpu_to_le32(i_uid_read(inode)); |
473 | ino->gid = cpu_to_le32(inode->i_gid); | 473 | ino->gid = cpu_to_le32(i_gid_read(inode)); |
474 | ino->mode = cpu_to_le32(inode->i_mode); | 474 | ino->mode = cpu_to_le32(inode->i_mode); |
475 | ino->flags = cpu_to_le32(ui->flags); | 475 | ino->flags = cpu_to_le32(ui->flags); |
476 | ino->size = cpu_to_le64(ui->ui_size); | 476 | ino->size = cpu_to_le64(ui->ui_size); |
diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c index 15e2fc5aa60b..52c21f4190f6 100644 --- a/fs/ubifs/sb.c +++ b/fs/ubifs/sb.c | |||
@@ -611,8 +611,8 @@ int ubifs_read_superblock(struct ubifs_info *c) | |||
611 | c->fanout = le32_to_cpu(sup->fanout); | 611 | c->fanout = le32_to_cpu(sup->fanout); |
612 | c->lsave_cnt = le32_to_cpu(sup->lsave_cnt); | 612 | c->lsave_cnt = le32_to_cpu(sup->lsave_cnt); |
613 | c->rp_size = le64_to_cpu(sup->rp_size); | 613 | c->rp_size = le64_to_cpu(sup->rp_size); |
614 | c->rp_uid = le32_to_cpu(sup->rp_uid); | 614 | c->rp_uid = make_kuid(&init_user_ns, le32_to_cpu(sup->rp_uid)); |
615 | c->rp_gid = le32_to_cpu(sup->rp_gid); | 615 | c->rp_gid = make_kgid(&init_user_ns, le32_to_cpu(sup->rp_gid)); |
616 | sup_flags = le32_to_cpu(sup->flags); | 616 | sup_flags = le32_to_cpu(sup->flags); |
617 | if (!c->mount_opts.override_compr) | 617 | if (!c->mount_opts.override_compr) |
618 | c->default_compr = le16_to_cpu(sup->default_compr); | 618 | c->default_compr = le16_to_cpu(sup->default_compr); |
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 1c766c39c038..f39bad9db61c 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -130,8 +130,8 @@ struct inode *ubifs_iget(struct super_block *sb, unsigned long inum) | |||
130 | 130 | ||
131 | inode->i_flags |= (S_NOCMTIME | S_NOATIME); | 131 | inode->i_flags |= (S_NOCMTIME | S_NOATIME); |
132 | set_nlink(inode, le32_to_cpu(ino->nlink)); | 132 | set_nlink(inode, le32_to_cpu(ino->nlink)); |
133 | inode->i_uid = le32_to_cpu(ino->uid); | 133 | i_uid_write(inode, le32_to_cpu(ino->uid)); |
134 | inode->i_gid = le32_to_cpu(ino->gid); | 134 | i_gid_write(inode, le32_to_cpu(ino->gid)); |
135 | inode->i_atime.tv_sec = (int64_t)le64_to_cpu(ino->atime_sec); | 135 | inode->i_atime.tv_sec = (int64_t)le64_to_cpu(ino->atime_sec); |
136 | inode->i_atime.tv_nsec = le32_to_cpu(ino->atime_nsec); | 136 | inode->i_atime.tv_nsec = le32_to_cpu(ino->atime_nsec); |
137 | inode->i_mtime.tv_sec = (int64_t)le64_to_cpu(ino->mtime_sec); | 137 | inode->i_mtime.tv_sec = (int64_t)le64_to_cpu(ino->mtime_sec); |
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 1e5a08623d11..64f2367c2f4c 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
@@ -1426,8 +1426,8 @@ struct ubifs_info { | |||
1426 | 1426 | ||
1427 | long long rp_size; | 1427 | long long rp_size; |
1428 | long long report_rp_size; | 1428 | long long report_rp_size; |
1429 | uid_t rp_uid; | 1429 | kuid_t rp_uid; |
1430 | gid_t rp_gid; | 1430 | kgid_t rp_gid; |
1431 | 1431 | ||
1432 | /* The below fields are used only during mounting and re-mounting */ | 1432 | /* The below fields are used only during mounting and re-mounting */ |
1433 | unsigned int empty:1; | 1433 | unsigned int empty:1; |