Skip to contentSkip to conversation

systemd: merge group members from /etc/group and nss-systemd

PATCH New Ross Burton 1 participant 1 message Oct 20

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 systemd: merge group members from /etc/group and nss-systemd

From: Martin Hundebøll <[email protected]>

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

---
 meta/recipes-core/systemd/systemd_262.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_262.bb +1 -1
index 46ef6554201..e1d64a5c941 100644
@@ -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
Signature · 1 line
2.43.0