Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

umask always zero? #256

Open
smessmer opened this issue Aug 20, 2023 · 1 comment
Open

umask always zero? #256

smessmer opened this issue Aug 20, 2023 · 1 comment

Comments

@smessmer
Copy link

smessmer commented Aug 20, 2023

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

@GermanCoding
Copy link

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,

pub const FUSE_DONT_MASK: u32 = 1 << 6; // don't apply umask to file mode on create operations
), 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants