-
Notifications
You must be signed in to change notification settings - Fork 335
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
install -d -o USER -g GROUP DEST doesn't set uid/gid #105
Comments
On 11/1/18 5:07 PM, Volodymyr Medvid wrote:
"install -d" doesn't honor custom uid/gid.
install_main returns early if (flags & FLAG_d), doing mkpathat without fchown.
Hmmm... I just pushed a patch to that, but it's not quiet right.
When calling lchown() it does xgetuid() and xgetgid() for the default values
you're not overriding (when you have -o or -g but not both). Technically that
should be the fsuid, but although there's a setfsuid() I can't find a _getfsuid()_?
Man 7 capabilities is uninformative. And I still dunno what the point of suid
is. (We added real and effective, but programs know to look for both of those
know and freak if they're different! Let's add /opt and start sticking files in
there, then we'll need /opt/usr for when people start to expect it!)
Sorry, that's another rant:
http://lists.busybox.net/pipermail/busybox/2010-December/074114.html
(Which I got slightly wrong: the / disk was half a megabyte, the rk05 disk packs
were 2.5 megabytes each. Still adds up to 3 megabytes though. Primary sources
are https://www.bell-labs.com/usr/dmr/www/notes.html and
https://www.bell-labs.com/usr/dmr/www/hist.html)
Anyway, install -d does what you expect now, UNLESS you run it in a context
where you've changed fsuid (which was implemented for samba, so the server could
read/write files as different users without having to fork and run entirely _as_
those users). That would be ignored on the last path component, but not the ones
before it.
Let me know if anybody comes up with a proper fix. :)
Rob
|
i'm not sure i understand this? seems like you're using -1 and letting it be the kernel's problem, so there's nothing left to do here?
|
@medvid --- do you have a test case that still doesn't work with current toybox? (i'll reopen if you just comment here. no need for a new bug.) otherwise, i think this was fixed years ago.. |
"install -d" doesn't honor custom uid/gid.
install_main returns early if (flags & FLAG_d), doing mkpathat without fchown.
The text was updated successfully, but these errors were encountered: