Skip to content

Commit

Permalink
Revert "FROMLIST: configfs: make directories inherit uid/gid from cre…
Browse files Browse the repository at this point in the history
…ator"

This reverts commit 311e1c8.

Reason for revert: uapi impacting changes can't be FROMLIST

Change-Id: I1d793178ab9a529f1be15a14c7e268e3e3953263
  • Loading branch information
adelva1984 committed Nov 6, 2021
1 parent b9de739 commit bd61bcc
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions fs/configfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1384,22 +1384,6 @@ static int configfs_mkdir(struct user_namespace *mnt_userns, struct inode *dir,
else
ret = configfs_attach_item(parent_item, item, dentry, frag);

/* inherit uid/gid from process creating the directory */
if (!uid_eq(current_fsuid(), GLOBAL_ROOT_UID) ||
!gid_eq(current_fsgid(), GLOBAL_ROOT_GID)) {
struct inode *inode = d_inode(dentry);
struct iattr ia = {
.ia_uid = current_fsuid(),
.ia_gid = current_fsgid(),
.ia_valid = ATTR_UID | ATTR_GID,
};

inode->i_uid = ia.ia_uid;
inode->i_gid = ia.ia_gid;
/* the above manual assignments skip the permission checks */
configfs_setattr(mnt_userns, dentry, &ia);
}

spin_lock(&configfs_dirent_lock);
sd->s_type &= ~CONFIGFS_USET_IN_MKDIR;
if (!ret)
Expand Down

0 comments on commit bd61bcc

Please sign in to comment.