]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
fuse2fs: respect requested mode in mkdir
authorSteven Luo <steven@steven676.net>
Thu, 23 Nov 2023 23:33:37 +0000 (15:33 -0800)
committerSteven Luo <steven@steven676.net>
Thu, 23 Nov 2023 23:43:53 +0000 (15:43 -0800)
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>
misc/fuse2fs.c

index 0dc77eadc53c3b22aea3a0a5ed1923d67ea96633..0eb216217b15d564d8d3b76fa63c6928d8ebe68b 100644 (file)
@@ -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++;