Skip to content

Commit

Permalink
userns: Convert hostfs to use kuid and kgid where appropriate
Browse files Browse the repository at this point in the history
Cc: Jeff Dike <[email protected]>
Cc: Richard Weinberger <[email protected]>
Acked-by: Serge Hallyn <[email protected]>
Signed-off-by: Eric W. Biederman <[email protected]>
  • Loading branch information
ebiederm committed Sep 21, 2012
1 parent 581abc0 commit 29f82ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 4 additions & 4 deletions fs/hostfs/hostfs_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ static int read_name(struct inode *ino, char *name)
ino->i_ino = st.ino;
ino->i_mode = st.mode;
set_nlink(ino, st.nlink);
ino->i_uid = st.uid;
ino->i_gid = st.gid;
i_uid_write(ino, st.uid);
i_gid_write(ino, st.gid);
ino->i_atime = st.atime;
ino->i_mtime = st.mtime;
ino->i_ctime = st.ctime;
Expand Down Expand Up @@ -808,11 +808,11 @@ int hostfs_setattr(struct dentry *dentry, struct iattr *attr)
}
if (attr->ia_valid & ATTR_UID) {
attrs.ia_valid |= HOSTFS_ATTR_UID;
attrs.ia_uid = attr->ia_uid;
attrs.ia_uid = from_kuid(&init_user_ns, attr->ia_uid);
}
if (attr->ia_valid & ATTR_GID) {
attrs.ia_valid |= HOSTFS_ATTR_GID;
attrs.ia_gid = attr->ia_gid;
attrs.ia_gid = from_kgid(&init_user_ns, attr->ia_gid);
}
if (attr->ia_valid & ATTR_SIZE) {
attrs.ia_valid |= HOSTFS_ATTR_SIZE;
Expand Down
2 changes: 0 additions & 2 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,6 @@ config UIDGID_CONVERTED
depends on UFS_FS = n
depends on XFS_FS = n

depends on !UML || HOSTFS = n

# The rare drivers that won't build
depends on ANDROID_BINDER_IPC = n

Expand Down

0 comments on commit 29f82ae

Please sign in to comment.