-
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: create /etc/passwd if missing #15003
libpod: create /etc/passwd if missing #15003
Conversation
3643483
to
bdcb98d
Compare
@@ -70,6 +70,11 @@ USER 1000`, ALPINE) | |||
session.WaitWithDefaultTimeout() | |||
Expect(session).Should(Exit(0)) | |||
Expect(session.OutputToString()).To(Not(ContainSubstring("passwd"))) | |||
|
|||
// test that the /etc/passwd file is created | |||
session = podmanTest.Podman([]string{"run", "--rm", "--user", "0:0", imgName, "ls", "/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.
Why do we need --user to create it? Feels like it should work even when the default user is used, no?
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 think it only creates the user account if --user is specified and user is not listed in /etc/passwd.
I guess we could remove check for --user and always check if the default user is listed in the /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.
it is the current behavior. I am fine with changing it but it is a separate change
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 think the current behavior makes sense; only codepaths that modify /etc/passwd will create it.
this needs to not happen if |
right, with |
bdcb98d
to
d7c52de
Compare
Changes LGTM. |
create the /etc/passwd and /etc/group files if they are missing in the image. Closes: containers#14966 Signed-off-by: Giuseppe Scrivano <[email protected]>
d7c52de
to
dd2b794
Compare
tests are fixed now |
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: flouthoc, giuseppe 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 |
/lgtm |
create the /etc/passwd file is it is missing in the image.
Closes: #14966
Signed-off-by: Giuseppe Scrivano [email protected]
Does this PR introduce a user-facing change?