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

Option To Create /etc/passwd If It Does Not Exist #14966

Closed
p0da opened this issue Jul 19, 2022 · 7 comments · Fixed by #15003
Closed

Option To Create /etc/passwd If It Does Not Exist #14966

p0da opened this issue Jul 19, 2022 · 7 comments · Fixed by #15003
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@p0da
Copy link

p0da commented Jul 19, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind feature

Description

Currently /etc/passwd is not created if it does not initially exist in the image, even if the --passwd/--passwd-entry flags are specified. Would it be possible to implement some option that enables podman to create /etc/passwd (probably /etc/group too) in order for the --passwd and --passwd-entry flags to have an effect in images that don't initially have a /etc/passwd?

@openshift-ci openshift-ci bot added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 19, 2022
@rhatdan
Copy link
Member

rhatdan commented Jul 19, 2022

Seems reasonable, interested in opening a PR?

@p0da
Copy link
Author

p0da commented Jul 20, 2022

Unfortunately I am not familiar enough with go make an attempt at it. However this functionality could also simply be added to the --passwd flag as that is what toggles the appending of entries.

@giuseppe
Copy link
Member

I don't see why we don't create the file if it is missing, @mheon is it because of some compatibility with Docker?

If that is the case, we could probably add --passwd=always to override this check and always create the file

@mheon
Copy link
Member

mheon commented Jul 20, 2022 via email

@rhatdan
Copy link
Member

rhatdan commented Jul 20, 2022

I agree we should create it if it does not exists. I don't think Docker has an equivalent. Most likely we just coded it to expect /etc/passwd exists in the container and do not handle ENOEXIST.

@mheon
Copy link
Member

mheon commented Jul 20, 2022

Yeah, concur. Not many images are missing a passwd file so it's not something we tested or thought of.

@giuseppe
Copy link
Member

opened a PR: #15003

Keep in mind that --passwd-entry won't be enough to trigger the entry, you'll need to specify --user= as well

giuseppe added a commit to giuseppe/libpod that referenced this issue Jul 21, 2022
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]>
mheon pushed a commit to mheon/libpod that referenced this issue Jul 26, 2022
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]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants