-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add support for supplementary groups #41
Comments
@brianhlin - what do you propose be done for supplementary groups though? How should we decide which one is used in creating the directory? also, the man page advice is not particularly helpful. seteuid works at the process level (all threads) while setfsuid works at the thread level. setfsuid is one of those calls that’s deprecated for decades but without a clear replacement for this use case IIRC. |
I know @juztas was interested in a solution here, too. To work around this problem we did the following:
(2) and (3) aren't great if the user has POSIX access as they may accidentally create world-readable files. I think (1) is a reasonable requirement to have. So as @matyasselmeci smartly pointed out, the real problem appears to be directory traversal. Maybe something silly like setting |
I mean, the right way to do this is to emulate how supplementary groups work. Maintain a timed-limited cache of the supplementary groups per user, open the parent directory when creating files, and then emulate the Linux directory creation logic. Similarly with opening files, we'd need to walk up the directory tree, checking permission at each step. Not impossible ... but certainly a lot more complicated than what we have today. |
We noticed an issue with support for group-owned directories where the
setfsgid
call appears to only get the primary group of the user (frequently the user-specific group, e.g.brianhlin
). This is not particularly useful for shared FS access of a dir tree so we'd like to see support added for supplementary groups, perhaps by usinggetgrouplist
andsetgroups
in addition to the the set UID/GID calls.We should also consider moving to
setuid
andsetgid
(or maybeseteuid
/setegid
?) assetfs*id
says:The text was updated successfully, but these errors were encountered: