diff mbox series

[v2] systemd: merge group members from /etc/group and nss-systemd

Message ID 20261020123506.1869634-1-ross.burton@arm.com
State Accepted, archived
Commit 4041c0e84b3e98841bca9ab1d35b763acc2c0db4
Headers show
Series [v2] systemd: merge group members from /etc/group and nss-systemd | expand

Commit Message

Ross Burton Oct. 20, 2026, 12:35 p.m. UTC
From: Martin Hundebøll <martin@geanix.com>

When systemd is configured with userdb and nss integration, it provides
group memberships in **addition** to those recorded in /etc/group. For
those additional memberships to be considered by nss, the group database
must be configured to merge the result from both /etc/group and the
systemd nss plugin.

[RB] Reference for the recommended configuration can be found at:
https://www.freedesktop.org/software/systemd/man/latest/nss-systemd.html

Signed-off-by: Martin Hundebøll <martin@geanix.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/recipes-core/systemd/systemd_262.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-core/systemd/systemd_262.bb b/meta/recipes-core/systemd/systemd_262.bb
index 46ef6554201..e1d64a5c941 100644
--- a/meta/recipes-core/systemd/systemd_262.bb
+++ b/meta/recipes-core/systemd/systemd_262.bb
@@ -907,7 +907,7 @@  pkg_postinst:${PN}:libc-glibc () {
 	fi
 	if ${@bb.utils.contains('PACKAGECONFIG', 'nss', 'true', 'false', d)}; then
 		sed -e 's#\(^passwd:.*\)#\1 systemd#' \
-			-e 's#\(^group:.*\)#\1 systemd#' \
+			-e 's#\(^group:.*\)#\1 [SUCCESS=merge] systemd#' \
 			-e 's#\(^shadow:.*\)#\1 systemd#' \
 			-i $D${sysconfdir}/nsswitch.conf
 	fi