profiles: include "systemd" in shadow + gshadow nsswitch.conf lines by poettering · Pull Request #380 · authselect/authselect · GitHub
Skip to content

profiles: include "systemd" in shadow + gshadow nsswitch.conf lines#380

Merged
pbrezina merged 1 commit into
authselect:masterfrom
poettering:shadow-nss-systemd
Jan 14, 2025
Merged

profiles: include "systemd" in shadow + gshadow nsswitch.conf lines#380
pbrezina merged 1 commit into
authselect:masterfrom
poettering:shadow-nss-systemd

Conversation

@poettering

Copy link
Copy Markdown
Contributor

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.

@keszybz keszybz left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

This is a natural followup to the previous patches that added systemd to passwd: and other lines.

@pbrezina

pbrezina commented Oct 9, 2024

Copy link
Copy Markdown
Member

@pbrezina pbrezina mentioned this pull request Nov 6, 2024
@pbrezina

pbrezina commented Nov 6, 2024

Copy link
Copy Markdown
Member

/packit build

2 similar comments
@pbrezina

pbrezina commented Jan 9, 2025

Copy link
Copy Markdown
Member

/packit build

@pbrezina

pbrezina commented Jan 9, 2025

Copy link
Copy Markdown
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.
@pbrezina

Copy link
Copy Markdown
Member

@pbrezina pbrezina merged commit 50b659f into authselect:master Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants