guix/gnu
Ludovic Courtès 3e2bd2e30b
services: nscd: Cause PID 1 to drop nscd database mappings on shutdown.
Partly fixes guix/guix#4269.

Fixes a bug whereby shepherd (PID 1) could retain memory mappings for
/var/run/nscd/dbXXX, which are created by glibc’s NSS from database file
descriptors sent by nscd.  Those mappings could then prevent
‘root-file-system’ from re-mounting the root file system as read-write.
This change causes PID 1 to drop these mappings.

PID 1 typically calls libc database functions such as ‘getgr’ when dealing
with AF_UNIX endpoints for socket-activated services, to look up the socket’s
owner and group.  This is where the bug would manifest.

The regression may have been introduced by
85ac164c41, which caused nscd to handle the
password and group databases.

* gnu/services/base.scm (nscd-shepherd-service): In ‘stop’ procedure, call
‘getpw’, ‘getgr’, and ‘getaddrinfo’.
* gnu/tests/base.scm (run-root-unmount-test) <"open libc NSS database">: New
test.
(%test-root-unmount): Add #:imported-modules.

Change-Id: I197cc8c82165c631f857415898137412ce9bd439
Reported-by: Rutherther <rutherther@ditigal.xyz>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #4828
2025-12-19 00:05:43 +01:00
..
bootloader
build system: Relax subordinate ID validation. 2025-12-11 15:43:16 +01:00
home Update Giacomo's email address. 2025-12-03 14:38:09 +09:00
installer
machine
packages gnu: ssh-to-pgp: Update to 1.1.6. 2025-12-18 22:39:56 +00:00
services services: nscd: Cause PID 1 to drop nscd database mappings on shutdown. 2025-12-19 00:05:43 +01:00
system system: Reinstate lock-mounts work around for system containers. 2025-12-16 09:32:07 +01:00
tests services: nscd: Cause PID 1 to drop nscd database mappings on shutdown. 2025-12-19 00:05:43 +01:00
artwork.scm
bootloader.scm
ci.scm
compression.scm
home.scm
image.scm
installer.scm
local.mk gnu: quickswitch-i3: Update to 2.8.0. 2025-12-18 22:29:42 +00:00
machine.scm
packages.scm
services.scm
system.scm
tests.scm