{{ message }}
profiles: include "systemd" in shadow + gshadow nsswitch.conf lines#380
Merged
Merged
Conversation
keszybz
approved these changes
Sep 24, 2024
keszybz
left a comment
There was a problem hiding this comment.
LGTM.
This is a natural followup to the previous patches that added systemd to passwd: and other lines.
Member
Member
|
/packit build |
2 similar comments
Member
|
/packit build |
Member
|
/packit build |
Since systemd v249 (2021) nss-systemd hasn't just been generating entries in the "passwd" and "group" databases, but in "shadow" and "gshadow" as well. This is documented in the man page: https://www.freedesktop.org/software/systemd/man/latest/nss-systemd.html This is generally useful, since various account validity fields that userdb/homed maintains are only exported via spwd/sgrp, but most importantly this makes the "systemd-nspawn --bind-user=" logic work, which just propagates the hashed user pw into a container. The patch is pretty simple: in all profiles where passwd/group already lists "systemd", we also add it to the lines with shadow/spwd, to the end.
cf6b31e to
964f416
Compare
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Since systemd v249 (2021) nss-systemd hasn't just been generating entries in the "passwd" and "group" databases, but in "shadow" and "gshadow" as well. This is documented in the man page:
https://www.freedesktop.org/software/systemd/man/latest/nss-systemd.html
This is generally useful, since various account validity fields that userdb/homed maintains are only exported via spwd/sgrp, but most importantly this makes the "systemd-nspawn --bind-user=" logic work, which just propagates the hashed user pw into a container.
The patch is pretty simple: in all profiles where passwd/group already lists "systemd", we also add it to the lines with shadow/spwd, to the end.