fuser icon indicating copy to clipboard operation
fuser copied to clipboard

umask always zero?

Open smessmer opened this issue 2 years ago • 1 comments

I checked the calls I'm getting in mkdir and create, and it seems that the calling process's umask is already automatically applied to the mode argument and the additional umask argument is always set to zero. Is this intentional? What is the umask argument supposed to be used for?

Fuser: 0.12.0 Filesystem setup: fuser::spawn_mount2 with empty set of options

smessmer avatar Aug 20 '23 15:08 smessmer

Looking at fuse configuration, it looks like this is configurable behaviour since ~ABI 7.12: The default seems to be that the kernel applies the umask for you, probably giving you a zero for the umask to ensure compatibility.

However, if you set FUSE_DONT_MASK during filesystem init (https://github.com/libfuse/libfuse/blob/9ca35f454f61df81af9bcb315908819fd2100696/include/fuse_kernel.h#L335, https://github.com/cberner/fuser/blob/8b390279a5da98df3f91b69aee8ef20de793a2fa/src/ll/fuse_abi.rs#L196), the umask should not be applied automatically by the kernel, and may thus be non-zero (note that a zero umask may be used by the process as well).

GermanCoding avatar Sep 29 '23 19:09 GermanCoding