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

install -d -o USER -g GROUP DEST doesn't set uid/gid #105

Closed
medvid opened this issue Nov 1, 2018 · 3 comments
Closed

install -d -o USER -g GROUP DEST doesn't set uid/gid #105

medvid opened this issue Nov 1, 2018 · 3 comments

Comments

@medvid
Copy link

medvid commented Nov 1, 2018

"install -d" doesn't honor custom uid/gid.
install_main returns early if (flags & FLAG_d), doing mkpathat without fchown.

@landley
Copy link
Owner

landley commented Nov 17, 2018 via email

@enh-google
Copy link
Collaborator

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()?

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?

  TT.uid = TT.i.o ? xgetuid(TT.i.o) : -1;
  TT.gid = TT.i.g ? xgetgid(TT.i.g) : -1;
...
        if (lchown(*ss, TT.uid, TT.gid)) perror_msg("chown '%s'", *ss);

@enh-google
Copy link
Collaborator

@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..

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

3 participants