opencontainers / opencontainers/runc
Support extrausers support in libcontainer/user
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 13.5k
- Forks
- 2.3k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 30
Description
The libcontainer methods for reading users, etc. currently only reads from /etc/passwd and /etc/group, however on Ubuntu Core devices (also yocto sometimes) it is desirably to also read the /var/lib/extrausers/passwd and /var/lib/extrausers/group files as well (from the pam_extrausers package in Ubuntu), as the /etc/passwd and /etc/group files are read-only and so any new users are added to the extrausers files instead of the /etc/passwd and /etc/group files.
I'm not sure what the design for this would look like, but it would be nice if the API that returns a io.Reader for the User/Group files (such as GetPasswd and GetGroup) just "auto-magically" included the /var/lib/extrausers files at the end of the /etc/passwd files via io.MultiReader. The *Path methods probably would have to remain the same behavior for backwards compatibility, but perhaps new methods returning a list of strings could be used to return all of the files if they exist?
I would be willing to submit a PR changing GetPasswd and GetGroup to include the extrausers patch if folks think this is a reasonable thing to do.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in libcontainer/user with the GetPasswd and GetGroup entry points and their corresponding *Path methods, reviewing how /etc/passwd and /etc/group are currently read. Define the backwards-compatible API behavior for optional /var/lib/extrausers/passwd and /var/lib/extrausers/group inputs, with completion meaning those files are included when present without changing the existing *Path behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100