From 1729d4a168a5cc3eddf5b6aeea9b845cd76c8f84 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 2 Feb 2016 09:06:00 +0100 Subject: [PATCH] tests: Always start tests as root so we can switch to a user Signed-off-by: Andreas Schneider --- tests/CMakeLists.txt | 2 +- tests/torture.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 06835cc3..222c3901 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -82,7 +82,7 @@ if (WITH_CLIENT_TESTING) configure_file(etc/pam.d/sshd.in ${CMAKE_CURRENT_BINARY_DIR}/etc/pam.d/sshd @ONLY) set(TORTURE_ENVIRONMENT "LD_PRELOAD=${SOCKET_WRAPPER_LIBRARY}:${NSS_WRAPPER_LIBRARY}:${UID_WRAPPER_LIBRARY}:${PAM_WRAPPER_LIBRARY}") - list(APPEND TORTURE_ENVIRONMENT UID_WRAPPER=1) + list(APPEND TORTURE_ENVIRONMENT UID_WRAPPER=1 UID_WRAPPER_ROOT=1) list(APPEND TORTURE_ENVIRONMENT NSS_WRAPPER_PASSWD=${CMAKE_CURRENT_BINARY_DIR}/etc/passwd) list(APPEND TORTURE_ENVIRONMENT NSS_WRAPPER_SHADOW=${CMAKE_CURRENT_BINARY_DIR}/etc/shadow) list(APPEND TORTURE_ENVIRONMENT NSS_WRAPPER_GROUP=${CMAKE_CURRENT_BINARY_DIR}/etc/group) diff --git a/tests/torture.c b/tests/torture.c index 46ed61b2..370e1796 100644 --- a/tests/torture.c +++ b/tests/torture.c @@ -964,7 +964,6 @@ void torture_setup_sshd_server(void **state) /* Set the default interface for the server */ setenv("SOCKET_WRAPPER_DEFAULT_IFACE", "10", 1); - setenv("UID_WRAPPER_ROOT", "1", 1); setenv("PAM_WRAPPER", "1", 1); s = *state; @@ -980,7 +979,6 @@ void torture_setup_sshd_server(void **state) usleep(500); setenv("SOCKET_WRAPPER_DEFAULT_IFACE", "21", 1); - unsetenv("UID_WRAPPER_ROOT"); unsetenv("PAM_WRAPPER"); }