fuse icon indicating copy to clipboard operation
fuse copied to clipboard

Sticky bit support ?

Open chrislusf opened this issue 4 years ago • 3 comments

https://en.wikipedia.org/wiki/Sticky_bit

The request I received by bazil/fuse does not have this bit. I wonder whether libfuse has support for sticky bit at all?

This showed up in pjdfstest POSIX tests https://github.com/pjd/pjdfstest/blob/master/tests/chmod/11.t#L27

chrislusf avatar Jan 12 '22 09:01 chrislusf

Looks like the kernel removes it intentionally:

https://github.com/torvalds/linux/blob/cb690f5238d71f543f4ce874aa59237cf53a877c/fs/fuse/inode.c#L201-L208

See also https://pkg.go.dev/bazil.org/fuse#DefaultPermissions

tv42 avatar Jan 12 '22 17:01 tv42

Oh, except on top of that we might be missing sticky bit handling where we convert to Go os.FileMode. Testing...

tv42 avatar Jan 12 '22 17:01 tv42

While we would fail to convert the incoming mode to include Go os.ModeSticky, I have yet to see the sticky bit in input, even with DefaultPermissions and running as root. Weird.

tv42 avatar Jan 12 '22 17:01 tv42

So I wasn't seeing a sticky bit in input because I was mixing unix mode bits and Go's shuffling of what bit means what, and giving garbage input to os.Chmod. Not the first time Go's concept of file mode has hurt me. With that, this is trivial! Commit coming soon.

tv42 avatar Dec 09 '22 17:12 tv42