diff mbox series

[v2,1/1] package/systemd: adopt odering in nsswitch to newer versions

Message ID 20211203230919.683527-1-nolange79@gmail.com
State Accepted
Headers show
Series [v2,1/1] package/systemd: adopt odering in nsswitch to newer versions | expand

Commit Message

Norbert Lange Dec. 3, 2021, 11:09 p.m. UTC
This modifies the order of the nss modules, reflecting the current
state of the documentation.

nss-mymachines lost support for resolution of users and groups,
and now only does resolution of hostnames. Changed in v246.

Multiple changes in regards to nss-myhostname now recommend placement
after nss-files and before nss-dns. See commits ce266330, f918c67.

nss-resolve handles the nss-files logic itself, and its suggested to
move in front of nss-files. Changed in v249.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
---
v1->v2:
-   fix whitespace issue with mymachines
---
 package/systemd/systemd.mk | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index 373e5c82bb..8e805e8cd1 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -563,13 +563,11 @@  define SYSTEMD_INSTALL_NSSCONFIG_HOOK
 		-e '/^gshadow:/ {/systemd/! s/$$/ systemd/}' \
 		$(if $(BR2_PACKAGE_SYSTEMD_RESOLVED), \
 			-e '/^hosts:/ s/[[:space:]]*mymachines//' \
-			-e '/^hosts:/ {/resolve/! s/files/files resolve [!UNAVAIL=return]/}' ) \
+			-e '/^hosts:/ {/resolve/! s/files/resolve [!UNAVAIL=return] files/}' ) \
 		$(if $(BR2_PACKAGE_SYSTEMD_MYHOSTNAME), \
-			-e '/^hosts:/ {/myhostname/! s/$$/ myhostname/}' ) \
+			-e '/^hosts:/ {/myhostname/! s/files/files myhostname/}' ) \
 		$(if $(BR2_PACKAGE_SYSTEMD_MACHINED), \
-			-e '/^passwd:/ {/mymachines/! s/files/files mymachines/}' \
-			-e '/^group:/ {/mymachines/! s/files/files [SUCCESS=merge] mymachines/}' \
-			-e '/^hosts:/ {/mymachines/! s/files/files mymachines/}' ) \
+			-e '/^hosts:/ {/mymachines/! s/^\(hosts:[[:space:]]*\)/\1mymachines /}' ) \
 		$(TARGET_DIR)/etc/nsswitch.conf
 endef