[merged] Only --unshare-user automatically if we're not root#123
Closed
cgwalters wants to merge 2 commits intocontainers:masterfrom
Closed
[merged] Only --unshare-user automatically if we're not root#123cgwalters wants to merge 2 commits intocontainers:masterfrom
cgwalters wants to merge 2 commits intocontainers:masterfrom
Conversation
containers#122 introduced a regression for the case of rpm-ostree running bubblewrap on CentOS 7. Previously the `is_privileged` variable captured whether or not our uid was 0, now it captures whether we're setuid. This bit of code enabled `--unshare-user` automatically if we're not privileged, but we suddenly started doing that for running as real uid 0 (CAP_SYS_ADMIN), which we don't want, since on CentOS/RHEL 7 today userns isn't even available to root without a module parameter and reboot. So, let's just do this only if not setuid *and* we're not uid 0 (really we should check "have CAP_SYS_ADMIN" but eh).
Collaborator
|
☀️ Test successful - status-redhatci |
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.
#122 introduced a
regression for the case of rpm-ostree running bubblewrap on CentOS 7.
Previously the
is_privilegedvariable captured whether or notour uid was 0, now it captures whether we're setuid.
This bit of code enabled
--unshare-userautomatically if we're notprivileged, but we suddenly started doing that for running as real uid
0 (CAP_SYS_ADMIN), which we don't want, since on CentOS/RHEL 7 today
userns isn't even available to root without a module parameter and
reboot.
So, let's just do this only if not setuid and we're not uid 0
(really we should check "have CAP_SYS_ADMIN" but eh).