diff options
author | Christof Schmitt <cs@samba.org> | 2019-03-11 16:26:48 -0700 |
---|---|---|
committer | Christof Schmitt <cs@samba.org> | 2019-04-18 17:21:17 +0000 |
commit | d006c769a9cad275339b18b08e13d48acb29d7fc (patch) | |
tree | 5cff5141be051c031fa0094e7cf8e70fa1c5d645 /nsswitch | |
parent | 84f6fdcef3b11ab4a4087c52f2f4c5a749a43b92 (diff) | |
download | samba-d006c769a9cad275339b18b08e13d48acb29d7fc.tar.gz |
nsswitch: Add testcase for checking output of wbinfo --sid-to-name
The username should always be returned in the DOMAISHORTNAME/USERNAME
format.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13831
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'nsswitch')
-rwxr-xr-x | nsswitch/tests/test_wbinfo_name_lookup.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/nsswitch/tests/test_wbinfo_name_lookup.sh b/nsswitch/tests/test_wbinfo_name_lookup.sh index c1d39c1a602..ee8ae11f4b1 100755 --- a/nsswitch/tests/test_wbinfo_name_lookup.sh +++ b/nsswitch/tests/test_wbinfo_name_lookup.sh @@ -31,6 +31,21 @@ testit "name-to-sid.upn" \ $wbinfo -n $DC_USERNAME@$REALM || \ failed=$(expr $failed + 1) +testit "name-to-sid.realm-user" \ + $wbinfo -n $REALM/$DC_USERNAME || \ + failed=$(expr $failed + 1) + +# For the name-to-sid.realm-user query, ensure +# that this does not change subsequent sid-to-name +# queries. +sid=$($wbinfo -n $REALM/$DC_USERNAME | sed -e 's/ .*//') +out=$($wbinfo -s $sid | sed -e 's/ .//') +# winbindd returns usernames in lowercase +lcuser=$(echo $DC_USERNAME | tr A-Z a-z) +testit "Verify DOMAIN/USER output" \ + test "$out" = "$DOMAIN/$lcuser" || \ + failed=$(expr $failed + 1) + # Two separator characters should fail testit_expect_failure "name-to-sid.double-separator" \ $wbinfo -n $DOMAIN//$DC_USERNAME || \ |