-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
libpod: do not parse --hostuser in base 8 #19816
libpod: do not parse --hostuser in base 8 #19816
Conversation
fix the parsing of --hostuser to treat the input in base 10. Closes: containers#19800 Signed-off-by: Giuseppe Scrivano <[email protected]>
1a010f3
to
702709a
Compare
|
||
# find a user with a uid > 100 that is a valid octal | ||
# Issue #19800 | ||
octal_user=$(awk -F\: '$1!="nobody" && $3>100 && $3~/^[0-7]+$/ {print $1 " " $3; exit}' /etc/passwd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just add/commit a user octal_user to a container image, are we guaranteed to have an image with such a user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't be able to run this test only with that image and cause it to fail on any other system where the user is not present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am saying you do it with a Containerfile
from $IMAGE
run useradd -u 8000 test-user
podman build -t testimage .
podman run --user test-user testimage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried and it won't work with --hostuser
, it fails with:
Error: creating temporary passwd file for container ff2b26bee3529ff2bd393b0a56b2f47ea98b9d134ed240ce43a91caa490cee25: user: unknown user test-user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok so the host user account must exist for this to work. So only a container within a container would work.
Thanks for taking this on! I'm trying the fix now, |
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe, vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
fix the parsing of --hostuser to treat the input in base 10.
Closes: #19800
Does this PR introduce a user-facing change?