diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2014-07-27 14:44:24 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-10-10 13:56:08 +0200 |
commit | 428db8a58c0c149d5efccc6d788f70916c1d34d7 (patch) | |
tree | 531147790cdabf2d81b56915bed7e3e29d878efe /src/tests/cwrap/cwrap_test_setup.sh | |
parent | 40b2be4f4312470044cdef460b02b66003f5c85f (diff) | |
download | sssd-428db8a58c0c149d5efccc6d788f70916c1d34d7.tar.gz sssd-428db8a58c0c149d5efccc6d788f70916c1d34d7.tar.xz sssd-428db8a58c0c149d5efccc6d788f70916c1d34d7.zip |
TESTS: Add a test to change user IDs
Adds a unit test using the nss_wrapper and uid_wrapper libraries that
exercises the ability to become another user.
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/tests/cwrap/cwrap_test_setup.sh')
-rwxr-xr-x | src/tests/cwrap/cwrap_test_setup.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tests/cwrap/cwrap_test_setup.sh b/src/tests/cwrap/cwrap_test_setup.sh new file mode 100755 index 000000000..0d35cb7e5 --- /dev/null +++ b/src/tests/cwrap/cwrap_test_setup.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +pkg-config --exists nss_wrapper || exit 1 +pkg-config --exists uid_wrapper || exit 1 + +nss_wrapper=$(pkg-config --libs nss_wrapper) +uid_wrapper=$(pkg-config --libs uid_wrapper) +if [ -z $nss_wrapper -o -z $uid_wrapper ]; then + echo "Cannot locate cwrap libraries" + exit 2 +fi + +export LD_PRELOAD="$nss_wrapper $uid_wrapper" +export NSS_WRAPPER_PASSWD=$CWRAP_TEST_SRCDIR/passwd +export NSS_WRAPPER_GROUP=$CWRAP_TEST_SRCDIR/group +export UID_WRAPPER=1 +export UID_WRAPPER_ROOT=1 |