-
Notifications
You must be signed in to change notification settings - Fork 286
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
Correctly set gid/uid when allow_other is used #403
Conversation
But... How could this have worked in earlier versions? |
I think files never got the correct GID ? |
The user in the bugzilla says that downgrading to 1.9.1 fixes the issue. I wonder what happened |
I also reproduced the |
I will let you tell me if it's OK for you to merge this 👍 |
Your explaination makes sense, I'll test this tomorrow morning! |
Hi,
I am using version 1.9.5 on raspbian (it did not work with the builtin RPM so I added the 1.9.5 .deb package manually for it was supposed to integrate a fix). I set up several directories as follows: In directories that belong to "famille" any user can read/write and create files/sub-directories. Example:user "louis" tries to create a file in /NAS/VISIBLE/donnes_dechiffres2/ag (that belongs to ag:parents) root@raspnas:~# encfs --version Directories are encrypted/decrypted with this CLI I also tried the switch "-o rw,dev,suid" but it made no difference. Mount command shows: or this with "-o rw,dev,suid" switch $ id 2019-10-31 16:48:45,427 VERBOSE fs block size = 1024, macBytes = 8, randBytes = 0 [MACFileIO.cpp:70] There is still the mknod error Creating a file successfully in a directory that belongs to louis:parents 2019-10-31 16:58:51,321 VERBOSE fs block size = 1024, macBytes = 8, randBytes = 0 [MACFileIO.cpp:70] |
Does all this permission plan work as you expect on the same FS used by EncFS, but out of EncFS (so with plain / unencrypted tree) ? |
Hi, So for the record (:p) I duplicated the "decrypted/encrypted" filesystem to another directory in the same tree. This directory has no encryption at all. groups of user "louis" Listing and permission of subdirectories of the plain/without encryption tree: $ cd test_nature $ ls -al Current listing of "ag" subdirectory that belongs to ag:parents: Creation of a file as user "louis": Proof that the file was really created As you can see, the file is created and its ownership is enforced accordingly. Creation of a sub-directory by user louis in the same "ag" directory: One again, permission/ownership are enforced accordingly (thanks to the stickybit for the group ownership). I did not find any clue so far. I thought at first that the permissions of the encrypted tree mattered (location where encfs stores/creates the encrypted files : .coffre2 in my case). Yet, it has the same permissions as my plain directory "test_nature". This is really confusing |
As a test, try removing group sticky bit on your folders ? |
This does not make any difference. A also tried to remove the stickybit on the parent folder. Same result. :) removal of the stickybit on the directory pi@raspnas:/NAS/VISIBLE/donnes_dechiffres2 $ sudo ls -al Attempt to create a new file $ touch /NAS/VISIBLE/donnes_dechiffres2/ag/file_without_stickybit_louis.txt Log failures |
The problem is that encfs does not properly handle supplementary groups yet. See rfjakob/gocryptfs#394 for a discussion on how this was solved in gocryptfs. |
Thank you for your answer in the gocryptfs thread. So I migrated to gocryptfs instead of encfs for I understand there is little chance that this gets solved in encfs in a near future :) |
Hi,
This change fixes the
setfsgid
bug found in #398 and should then fix this issue.Fix was to run
setfsgid
beforesetfsuid
, as of course the reverse order can't work.Ben