]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
elf: test: handle different rootsbindir in tst-ldconfig-cache master
authorXi Ruoyao <xry111@xry111.site>
Sat, 25 Jul 2026 16:11:44 +0000 (00:11 +0800)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 28 Jul 2026 07:28:37 +0000 (09:28 +0200)
When compiling a glibc for a merged-/usr distro people may set
rootsbindir=/usr/sbin.  But tst-ldconfig-cache has hard-coded
/sbin/ldconfig path and so it fails with a different rootsbindir.

Fix it by using support_install_rootsbindir like run_ldconfig in
test-container.c.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
elf/tst-ldconfig-cache.c

index 9f71418b3a3d0c3efa84d39208046ef478c9ee3f..f4820a1822a5c1883bfdea75b237fedc45c6bcef 100644 (file)
@@ -85,7 +85,10 @@ corrupt (void)
 static void
 ldconfig (void)
 {
-  xsystem ("/sbin/ldconfig -X");
+  char *cmd = xasprintf("%s/ldconfig -X", support_install_rootsbindir);
+  xsystem (cmd);
+
+  free(cmd);
 }
 
 /* Change ld.so.conf to refer to the new directory, and generate a new