aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Luo <steven@steven676.net>2023-11-23 15:33:37 -0800
committerSteven Luo <steven@steven676.net>2023-11-23 15:43:53 -0800
commit4cfa9f70fb0fb3f42c4d9e79ee2d401d4968e1b0 (patch)
treeb5dc2747cf5558caa8a2c426365fea9f7177a51c
parentfe93a29695f7398046bc9c6aea43ba890687c4c4 (diff)
downloade2fsprogs-4cfa9f70fb0fb3f42c4d9e79ee2d401d4968e1b0.tar.gz
fuse2fs: respect requested mode in mkdir
At the moment, op_mkdir() ORs the requested mode with fs->umask, which results in the group/other write permission bits always being cleared regardless of what the creating process requested. Instead, leave the requested mode alone so that the resulting directory has the permssions the creator expects. Signed-off-by: Steven Luo <steven@steven676.net>
-rw-r--r--misc/fuse2fs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index 0dc77eadc..0eb216217 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -1129,7 +1129,7 @@ static int op_mkdir(const char *path, mode_t mode)
ext2fs_set_i_uid_high(inode, ctxt->uid >> 16);
inode.i_gid = ctxt->gid;
ext2fs_set_i_gid_high(inode, ctxt->gid >> 16);
- inode.i_mode = LINUX_S_IFDIR | (mode & ~(S_ISUID | fs->umask)) |
+ inode.i_mode = LINUX_S_IFDIR | (mode & ~S_ISUID) |
parent_sgid;
inode.i_generation = ff->next_generation++;