Skip to content

Commit

Permalink
fat: port to vfs{g,u}id_t and associated helpers
Browse files Browse the repository at this point in the history
A while ago we introduced a dedicated vfs{g,u}id_t type in commit
1e5267c ("mnt_idmapping: add vfs{g,u}id_t"). We already switched
over a good part of the VFS. Ultimately we will remove all legacy
idmapped mount helpers that operate only on k{g,u}id_t in favor of the
new type safe helpers that operate on vfs{g,u}id_t.

Cc: Seth Forshee (Digital Ocean) <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: OGAWA Hirofumi <[email protected]>
Cc: [email protected]
Signed-off-by: Christian Brauner (Microsoft) <[email protected]>
Acked-by: OGAWA Hirofumi <[email protected]>
  • Loading branch information
brauner committed Sep 20, 2022
1 parent b90cb10 commit 41d27f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/fat/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,9 @@ static int fat_allow_set_time(struct user_namespace *mnt_userns,
{
umode_t allow_utime = sbi->options.allow_utime;

if (!uid_eq(current_fsuid(), i_uid_into_mnt(mnt_userns, inode))) {
if (in_group_p(i_gid_into_mnt(mnt_userns, inode)))
if (!vfsuid_eq_kuid(i_uid_into_vfsuid(mnt_userns, inode),
current_fsuid())) {
if (vfsgid_in_group_p(i_gid_into_vfsgid(mnt_userns, inode)))
allow_utime >>= 3;
if (allow_utime & MAY_WRITE)
return 1;
Expand Down

0 comments on commit 41d27f5

Please sign in to comment.