Commit d012a7e8 authored by Christof Schmitt's avatar Christof Schmitt Committed by Karolin Seeger

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=13831Signed-off-by: 's avatarChristof Schmitt <cs@samba.org>
Reviewed-by: 's avatarVolker Lendecke <vl@samba.org>
(cherry picked from commit d006c769a9cad275339b18b08e13d48acb29d7fc)
parent a9f7f1f7
......@@ -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 || \
......
......@@ -346,3 +346,4 @@
# Disabling NTLM means you can't use samr to change the password
^samba.tests.ntlmdisabled.python\(ktest\).ntlmdisabled.NtlmDisabledTests.test_samr_change_password\(ktest\)
^samba.tests.ntlmdisabled.python\(ad_dc_no_ntlm\).ntlmdisabled.NtlmDisabledTests.test_ntlm_connection\(ad_dc_no_ntlm\)
^samba3.wbinfo_name_lookup.Verify DOMAIN/USER output\(ad_member\)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment