summaryrefslogtreecommitdiff
path: root/nss/tst-nss-files-alias-truncated.c
diff options
context:
space:
mode:
Diffstat (limited to 'nss/tst-nss-files-alias-truncated.c')
-rw-r--r--nss/tst-nss-files-alias-truncated.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/nss/tst-nss-files-alias-truncated.c b/nss/tst-nss-files-alias-truncated.c
index 2d6aba3c0e..029ae6a2a7 100644
--- a/nss/tst-nss-files-alias-truncated.c
+++ b/nss/tst-nss-files-alias-truncated.c
@@ -17,11 +17,13 @@
<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
@@ -42,8 +44,9 @@ in_chroot (void *closure)
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 ();