summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsource3/script/tests/selftest.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/source3/script/tests/selftest.sh b/source3/script/tests/selftest.sh
index 09f7dc8c97..9994e47035 100755
--- a/source3/script/tests/selftest.sh
+++ b/source3/script/tests/selftest.sh
@@ -302,6 +302,7 @@ EOF
## create a test account
##
+if [ "$USERID" != 0 ]; then
cat >$NSS_WRAPPER_PASSWD<<EOF
root:x:65533:65532:root gecos:$PREFIX_ABS:/bin/false
nobody:x:65534:65533:nobody gecos:$PREFIX_ABS:/bin/false
@@ -314,6 +315,21 @@ nogroup:x:65534:nobody
root:x:65532:
$USERNAME-group:x:$GROUPID:
EOF
+else
+##
+## Running as root...
+##
+cat >$NSS_WRAPPER_PASSWD<<EOF
+$USERNAME:x:$USERID:$GROUPID:$USERNAME gecos:$PREFIX_ABS:/bin/false
+nobody:x:65534:65533:nobody gecos:$PREFIX_ABS:/bin/false
+EOF
+
+cat >$NSS_WRAPPER_GROUP<<EOF
+$USERNAME-group:x:$GROUPID:
+nobody:x:65533:
+nogroup:x:65534:nobody
+EOF
+fi
MAKE_TEST_BINARY="bin/smbpasswd"
export MAKE_TEST_BINARY