diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-02-07 19:28:57 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-09-21 06:13:23 -0400 |
commit | 29f82ae56e8798f7907d60145e0186082800d130 (patch) | |
tree | 761298823c964f5e3ac9a0ca423450ce5cacf52a | |
parent | 581abc09c2205e05256d7f75410345d5392d5098 (diff) |
userns: Convert hostfs to use kuid and kgid where appropriate
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
-rw-r--r-- | fs/hostfs/hostfs_kern.c | 8 | ||||
-rw-r--r-- | init/Kconfig | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 124146543aa7..6c9f3a9d5e21 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -542,8 +542,8 @@ static int read_name(struct inode *ino, char *name) | |||
542 | ino->i_ino = st.ino; | 542 | ino->i_ino = st.ino; |
543 | ino->i_mode = st.mode; | 543 | ino->i_mode = st.mode; |
544 | set_nlink(ino, st.nlink); | 544 | set_nlink(ino, st.nlink); |
545 | ino->i_uid = st.uid; | 545 | i_uid_write(ino, st.uid); |
546 | ino->i_gid = st.gid; | 546 | i_gid_write(ino, st.gid); |
547 | ino->i_atime = st.atime; | 547 | ino->i_atime = st.atime; |
548 | ino->i_mtime = st.mtime; | 548 | ino->i_mtime = st.mtime; |
549 | ino->i_ctime = st.ctime; | 549 | ino->i_ctime = st.ctime; |
@@ -808,11 +808,11 @@ int hostfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
808 | } | 808 | } |
809 | if (attr->ia_valid & ATTR_UID) { | 809 | if (attr->ia_valid & ATTR_UID) { |
810 | attrs.ia_valid |= HOSTFS_ATTR_UID; | 810 | attrs.ia_valid |= HOSTFS_ATTR_UID; |
811 | attrs.ia_uid = attr->ia_uid; | 811 | attrs.ia_uid = from_kuid(&init_user_ns, attr->ia_uid); |
812 | } | 812 | } |
813 | if (attr->ia_valid & ATTR_GID) { | 813 | if (attr->ia_valid & ATTR_GID) { |
814 | attrs.ia_valid |= HOSTFS_ATTR_GID; | 814 | attrs.ia_valid |= HOSTFS_ATTR_GID; |
815 | attrs.ia_gid = attr->ia_gid; | 815 | attrs.ia_gid = from_kgid(&init_user_ns, attr->ia_gid); |
816 | } | 816 | } |
817 | if (attr->ia_valid & ATTR_SIZE) { | 817 | if (attr->ia_valid & ATTR_SIZE) { |
818 | attrs.ia_valid |= HOSTFS_ATTR_SIZE; | 818 | attrs.ia_valid |= HOSTFS_ATTR_SIZE; |
diff --git a/init/Kconfig b/init/Kconfig index 381f765df923..8450442da6cd 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -957,8 +957,6 @@ config UIDGID_CONVERTED | |||
957 | depends on UFS_FS = n | 957 | depends on UFS_FS = n |
958 | depends on XFS_FS = n | 958 | depends on XFS_FS = n |
959 | 959 | ||
960 | depends on !UML || HOSTFS = n | ||
961 | |||
962 | # The rare drivers that won't build | 960 | # The rare drivers that won't build |
963 | depends on ANDROID_BINDER_IPC = n | 961 | depends on ANDROID_BINDER_IPC = n |
964 | 962 | ||