summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2012-01-29 22:12:40 -0800
committerMatthieu Patou <mat@matws.net>2012-01-30 08:23:11 -0800
commit7350d994096efa62031f4f75cf92fb4ade2b2655 (patch)
tree8e80fb2bc12e1f1aab2fd595a30bb83d367df0f4
parent959d13ac204db88613e1b81eff72575c5a8f8edb (diff)
downloadsamba-7350d994096efa62031f4f75cf92fb4ade2b2655.tar.gz
samba-7350d994096efa62031f4f75cf92fb4ade2b2655.tar.bz2
samba-7350d994096efa62031f4f75cf92fb4ade2b2655.zip
s3: check that a user in a bogus domain name is mapped to the localnetbios name of a domain member
This means that if we authentify for BOGUS\administrator in AD domain FOREST with samba being domain member with the netbiosname MEMBER then BOGUS\administrator will be mapped to MEMBER\administrator if the password match.
-rwxr-xr-xsource4/selftest/tests.py1
-rwxr-xr-xtestprogs/blackbox/bogus.sh20
2 files changed, 21 insertions, 0 deletions
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index 82f0ae9872..ccc899bd1e 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -367,6 +367,7 @@ for mech in [
plansmbtorturetestsuite('base.xcopy', "plugin_s4_dc",
['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s administrator" % name)
+plantestsuite("samba4.blackbox.bogusdomain", "s3member", ["testprogs/blackbox/bogus.sh", "$NETBIOSNAME", "xcopy_share", '$DC_USERNAME', '$DC_PASSWORD'], allow_empty_output=True)
for mech in [
"-k no",
"-k no --option=usespnego=no",
diff --git a/testprogs/blackbox/bogus.sh b/testprogs/blackbox/bogus.sh
new file mode 100755
index 0000000000..019957bf70
--- /dev/null
+++ b/testprogs/blackbox/bogus.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+if [ $# -lt 1 ]; then
+cat <<EOF
+Usage: blackbox_newuser.sh PREFIX
+EOF
+exit 1;
+fi
+
+. `dirname $0`/subunit.sh
+
+SERVER=$1
+SHARE=$2
+USER=$3
+PWD=$4
+smbclient="$BINDIR/smbclient"
+testit_expect_failure "smbclient" $smbclient "//$SERVER/$SHARE" -W POUET -U$USER%$PWD -c "dir"&& failed=`expr $failed + 1`
+./bin/net rpc user add $USER $PWD -W $SERVER -U$USER%$PWD -S $SERVER
+testit "smbclient" $smbclient "//$SERVER/$SHARE" -W POUET -U$USER%$PWD -c "dir"|| failed=`expr $failed + 1`
+exit $failed