Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327286
b: refs/heads/master
c: 43b5e4c
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman committed Sep 21, 2012
1 parent 19d8bbd commit 56869ba
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d001b0536562f816af7eb9947e49de58f504958a
refs/heads/master: 43b5e4ccd463a5b42e0531c32628ac462081cab8
4 changes: 2 additions & 2 deletions trunk/fs/hfs/hfs_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ struct hfs_sb_info {
permissions on all files */
umode_t s_dir_umask; /* The umask applied to the
permissions on all dirs */
uid_t s_uid; /* The uid of all files */
gid_t s_gid; /* The gid of all files */
kuid_t s_uid; /* The uid of all files */
kgid_t s_gid; /* The gid of all files */

int session, part;
struct nls_table *nls_io, *nls_disk;
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/hfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,9 @@ int hfs_inode_setattr(struct dentry *dentry, struct iattr * attr)

/* no uig/gid changes and limit which mode bits can be set */
if (((attr->ia_valid & ATTR_UID) &&
(attr->ia_uid != hsb->s_uid)) ||
(!uid_eq(attr->ia_uid, hsb->s_uid))) ||
((attr->ia_valid & ATTR_GID) &&
(attr->ia_gid != hsb->s_gid)) ||
(!gid_eq(attr->ia_gid, hsb->s_gid))) ||
((attr->ia_valid & ATTR_MODE) &&
((S_ISDIR(inode->i_mode) &&
(attr->ia_mode != inode->i_mode)) ||
Expand Down
16 changes: 13 additions & 3 deletions trunk/fs/hfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ static int hfs_show_options(struct seq_file *seq, struct dentry *root)
seq_printf(seq, ",creator=%.4s", (char *)&sbi->s_creator);
if (sbi->s_type != cpu_to_be32(0x3f3f3f3f))
seq_printf(seq, ",type=%.4s", (char *)&sbi->s_type);
seq_printf(seq, ",uid=%u,gid=%u", sbi->s_uid, sbi->s_gid);
seq_printf(seq, ",uid=%u,gid=%u",
from_kuid_munged(&init_user_ns, sbi->s_uid),
from_kgid_munged(&init_user_ns, sbi->s_gid));
if (sbi->s_file_umask != 0133)
seq_printf(seq, ",file_umask=%o", sbi->s_file_umask);
if (sbi->s_dir_umask != 0022)
Expand Down Expand Up @@ -254,14 +256,22 @@ static int parse_options(char *options, struct hfs_sb_info *hsb)
printk(KERN_ERR "hfs: uid requires an argument\n");
return 0;
}
hsb->s_uid = (uid_t)tmp;
hsb->s_uid = make_kuid(current_user_ns(), (uid_t)tmp);
if (!uid_valid(hsb->s_uid)) {
printk(KERN_ERR "hfs: invalid uid %d\n", tmp);
return 0;
}
break;
case opt_gid:
if (match_int(&args[0], &tmp)) {
printk(KERN_ERR "hfs: gid requires an argument\n");
return 0;
}
hsb->s_gid = (gid_t)tmp;
hsb->s_gid = make_kgid(current_user_ns(), (gid_t)tmp);
if (!gid_valid(hsb->s_gid)) {
printk(KERN_ERR "hfs: invalid gid %d\n", tmp);
return 0;
}
break;
case opt_umask:
if (match_octal(&args[0], &tmp)) {
Expand Down
1 change: 0 additions & 1 deletion trunk/init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,6 @@ config UIDGID_CONVERTED
depends on CODA_FS = n
depends on FUSE_FS = n
depends on GFS2_FS = n
depends on HFS_FS = n
depends on HFSPLUS_FS = n
depends on HPFS_FS = n
depends on ISO9660_FS = n
Expand Down

0 comments on commit 56869ba

Please sign in to comment.