+2019-03-14 Florian Weimer <fweimer@redhat.com>
+
+ * nss/tst-nss-files-alias-truncated.c (do_test): Load
+ libnss_files.
+ * nss/Makefile (tst-nss-files-alias-truncated): Link with -ldl,
+ but not with libnss_files.
+ (tst-nss-files-alias-truncated.out): Depend on libnss_files.
+
2019-03-14 Zack Weinberg <zackw@panix.com>
* scripts/check-obsolete-constructs.py (HeaderChecker.check):
$(objpfx)tst-nss-files-hosts-getent: $(libdl)
$(objpfx)tst-nss-files-alias-leak: $(libdl)
$(objpfx)tst-nss-files-alias-leak.out: $(objpfx)/libnss_files.so
-$(objpfx)tst-nss-files-alias-truncated: $(objpfx)/libnss_files.so
+$(objpfx)tst-nss-files-alias-truncated: $(libdl)
+$(objpfx)tst-nss-files-alias-truncated.out: $(objpfx)/libnss_files.so
<http://www.gnu.org/licenses/>. */
#include <aliases.h>
+#include <gnu/lib-names.h>
#include <nss.h>
#include <stddef.h>
#include <support/check.h>
#include <support/namespace.h>
#include <support/test-driver.h>
+#include <support/xdlfcn.h>
#include <support/xunistd.h>
static void
static int
do_test (void)
{
- /* nss_files has already been loaded via DT_NEEDED, outside the
- chroot. */
+ /* Make sure we don't try to load the module in the chroot. */
+ xdlopen (LIBNSS_FILES_SO, RTLD_NOW);
+
__nss_configure_lookup ("aliases", "files");
support_become_root ();