install: do not call chown when called as root#9477
Merged
sylvestre merged 1 commit intouutils:mainfrom Dec 5, 2025
Merged
Conversation
|
GNU testsuite comparison: |
- `pseudo` is a tool which simulates being root by intercepting calls to e.g. `geteuid` and `chown` (by using the `LD_PRELOAD` mechanism). This is used e.g. to build filesystems for embedded devices without running as root on the build machine. - the `chown` call getting removed in this commit does not work when running with `pseudo` and using `PSEUDO_IGNORE_PATHS`: in this case, the call to `geteuid()` gets intercepted by `libpseudo.so` and returns 0, however the call to `chown()` isn't intercepted by `libpseudo.so` in case it is in a path from `PSEUDO_IGNORE_PATHS`, and will thus fail since the process is not really root - the call to `chown()` was added in uutils#5735 with the intent of making the test `install-C-root.sh` pass, however it isn't required (GNU coreutils also does not call `chown` just because `install` was called as root) Fixes uutils#9116 Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
68ed52e to
b7e037f
Compare
Collaborator
Author
|
I've not forgotten about CI, but in this particular case it's not easy to add a meaningful test. I can add a full end-to-end test using libpseudo, but it would add an extra dependency on a Ubuntu package just for the tests. I can skip the test when the dependency is not there, but it seems to me that the extra complexity is not worth it. Also there is already a test which is calling |
|
GNU testsuite comparison: |
Contributor
Collaborator
Author
|
This is ready for review. I don't intend to work on this branch any more. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pseudo is a tool which simulates being root by intercepting calls to e.g.
geteuidandchown(by using theLD_PRELOADmechanism). This is used e.g. by yocto to build filesystems for embedded devices without running as root on the build machine.the
chowncall getting removed in this commit does not work when running withpseudoand usingPSEUDO_IGNORE_PATHS: in this case, the call togeteuid()gets intercepted bylibpseudo.soand returns 0, however the call tochown()isn't intercepted bylibpseudo.soin case it is in a path fromPSEUDO_IGNORE_PATHS, and will thus fail since the process is not really rootthe call to
chown()was added in install: Manages permissions when run as root #5735 with the intent of making the testinstall-C-root.shpass, however it isn't required (GNU coreutils also does not callchownjust becauseinstallwas called as root)Fixes #9116