-
Notifications
You must be signed in to change notification settings - Fork 170
Use sysusers only at compose-time for container-native path #3606
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
base: testing-devel
Are you sure you want to change the base?
Conversation
|
Hmm, CI is failing on which I think is because https://builds.coreos.fedoraproject.org/prod/streams/testing-devel/builds/42.20250721.20.0/x86_64/meta.json doesn't have an |
|
OK right, it's because we I think it would make sense to also upload the OCI manifest, but I guess the prune code should be tolerant to this anyway: coreos/coreos-assembler#4236 |
travier
left a comment
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 but not tested. We would need to double check that nothing changes.
Rather than sorting by name, it's more useful I find to sort by UID/GID because it makes it more obvious if two UIDs are the same since they'd be next to each other.
No functional change. Prep to make next patch easier to review.
We have a bunch of users and groups added at compose time which are not currently fixated and so risk drifting in the future as packages get added and removed. Fixate those. Ideally we should have CI checks for this even so that we keep this list up to date. The longer-term fix for this is to reduce as much as possible the number of sysusers truly required at compose time which e.g. requires packaging changes.
fedora-bootc today defines its own passwd/group files which were
originally based on the Fedora CoreOS ones (which in turn came from
Fedora Atomic).
The main problem with that is that we have our own passwd/group files
which we want to be able to use. There is no interface for passing this
to bootc-base-imagectl and it would be awkward to add one. Hence the
`PASSWD_GROUP_DIR` hack.
More recently, `bootc-base-imagectl` learned a new `--sysusers` option
in which we can opt-out of the centralized passwd/group file and have
full control over UID allocation via sysusers dropins. Use it. Also use
the hidden `--nobody-99` option for backwards compatibility.
All the entries in our passwd/group files are already present in our
sysusers dropins, so this is in fact functionally equivalent. Notably
this does not change anything about nss-altfiles. The entries in
`/usr/lib/{passwd,group}` remain the exact same.
This allows us to stop using the `PASSWD_GROUP_DIR` hack for FCOS
at least. For RHCOS, we'll have to keep it for RHEL 9.6. But because
buildah prints a warning if a build arg is undefined, set the default
value to "none".
Note this does not affect the legacy cosa build path. The in-tree
passwd/group files are still used there.
For more information, see:
- coreos/rpm-ostree#5427
- https://gitlab.com/fedora/bootc/base-images/-/merge_requests/242
- https://gitlab.com/fedora/bootc/base-images/-/merge_requests/243
8d51a73 to
46641da
Compare
|
Rebased this now! I've removed the change to If one does a And now it looks slightly different: Those are mostly equivalent though if you read
Either way, users can't directly access the group using a group password. |
|
Hmm, though I do see also this in -root:*::0:99999:7:::
+root:!unprovisioned:::::::which is weird. One has passwords disabled entirely, whereas the other has it just locked. Will look at squashing that. Edit: comes from https://github.com/systemd/systemd/blob/1f0acba5121cab17fe447c1e0aebfabf177ce1e8/src/basic/user-util.h#L146-L149 I think. |
fedora-bootc today defines its own passwd/group files which were originally based on the Fedora CoreOS ones (which in turn came from Fedora Atomic).
The main problem with that is that we have our own passwd/group files which we want to be able to use. There is no interface for passing this to bootc-base-imagectl and it would be awkward to add one. Hence the
PASSWD_GROUP_DIRhack.More recently,
bootc-base-imagectllearned a new--sysusersoption in which we can opt-out of the centralized passwd/group file and have full control over UID allocation via sysusers dropins. Use it. Also use the hidden--nobody-99option for backwards compatibility.All the entries in our passwd/group files are already present in our sysusers dropins, so this is in fact functionally equivalent. Notably this does not change anything about nss-altfiles. The entries in
/usr/lib/{passwd,group}remain the exact same.This allows us to stop using the
PASSWD_GROUP_DIRhack for FCOS at least. For RHCOS, we'll have to keep it for RHEL 9.6. But because buildah prints a warning if a build arg is undefined, set the default value to "none".Note this does not affect the legacy cosa build path. The in-tree passwd/group files are still used there.
For more information, see:
sysusers:knob rpm-ostree#5427