summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2017-03-31 16:06:18 +0200
committerJeremy Allison <jra@samba.org>2017-04-01 17:33:14 +0200
commit2150de3a73527850547263e853faf4f3fedca6e6 (patch)
treeef6e1464415e186bd82b6b29e759a9d3506c54c8 /nsswitch
parent6b7a14b4b9c3411bd2e05383917e8fdedae51c90 (diff)
downloadsamba-2150de3a73527850547263e853faf4f3fedca6e6.tar.gz
selftest: wbinfo -s tests for wellknown SIDs
Bug: https://bugzilla.samba.org/show_bug.cgi?id=12727 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'nsswitch')
-rwxr-xr-xnsswitch/tests/test_wbinfo.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/nsswitch/tests/test_wbinfo.sh b/nsswitch/tests/test_wbinfo.sh
index f9c040e5f43..d298ddb947e 100755
--- a/nsswitch/tests/test_wbinfo.sh
+++ b/nsswitch/tests/test_wbinfo.sh
@@ -88,6 +88,26 @@ else
echo "success: wbinfo -s check for sane mapping"
fi
+WELL_KNOWN_SIDS="S-1-1-0\n /EVERYONE 5\n S-1-3-1\n /CREATOR GROUP 5\n S-1-5-1\n NT AUTHORITY/DIALUP 5"
+
+printf "$WELL_KNOWN_SIDS" | while read SID ; do
+ read NAME
+
+ testit "wbinfo -s $SID against $TARGET" $wbinfo -s $SID || failed=`expr $failed + 1`
+
+ RESOLVED_NAME=`$wbinfo -s $SID | tr a-z A-Z`
+ echo "$SID resolved to $RESOLVED_NAME"
+
+ echo "test: wbinfo -s $SID against $TARGET"
+ if test x"$RESOLVED_NAME" != x"$NAME" ; then
+ echo "$RESOLVED_NAME does not match $NAME"
+ echo "failure: wbinfo -s $SID against $TARGET"
+ failed=`expr $failed + 1`
+ else
+ echo "success: wbinfo -s $SID against $TARGET"
+ fi
+done
+
testit "wbinfo -n on the returned name against $TARGET" $wbinfo -n $admin_name || failed=`expr $failed + 1`
test_sid=`$wbinfo -n $tested_name | cut -d " " -f1`