]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:selftest add a test for rpcclient --pw-nt-hash option
authorChristian Ambach <ambi@samba.org>
Wed, 11 May 2016 17:21:20 +0000 (19:21 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 31 May 2016 14:34:38 +0000 (16:34 +0200)
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit d0cdf02dc9733dae960021ff1ca07587d8155e58)

Autobuild-User(v4-3-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-3-test): Tue May 31 16:34:38 CEST 2016 on sn-devel-104

source3/script/tests/test_rpcclient_pw_nt_hash.sh [new file with mode: 0755]
source3/selftest/tests.py

diff --git a/source3/script/tests/test_rpcclient_pw_nt_hash.sh b/source3/script/tests/test_rpcclient_pw_nt_hash.sh
new file mode 100755 (executable)
index 0000000..c03d22f
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Blackbox tests for the rpcclient --pw-nt-hash option
+#
+
+if [ $# -lt 4 ]; then
+cat <<EOF
+Usage: test_rpcclient_pw_nt_hash.sh USERNAME PASSWORD SERVER RPCCLIENT
+EOF
+exit 1;
+fi
+
+USERNAME="$1"
+PASSWORD="$2"
+SERVER="$3"
+RPCCLIENT="$4"
+
+HASH=`echo -n $PASSWORD | iconv -t utf16le | openssl md4 |cut -d ' ' -f2`
+
+RPCCLIENTCMD="$RPCCLIENT $SERVER --pw-nt-hash -U$USERNAME%$HASH -c queryuser"
+
+incdir=$(dirname $0)/../../../testprogs/blackbox
+. $incdir/subunit.sh
+
+testit "rpcclient --pw-nt-hash" $RPCCLIENTCMD || failed=`expr $failed + 1`
+
+testok $0 $failed
index c0108e0e5240a730b19f2282d2124ee3ea45f273..546b1a00475a6f11f0a254736756567234d40d54 100755 (executable)
@@ -456,6 +456,11 @@ plantestsuite("samba3.blackbox.rpcclient_srvsvc", "simpleserver",
                "$USERNAME", "$PASSWORD", "$SERVER",
                os.path.join(bindir(), "rpcclient"), "tmp"])
 
+plantestsuite("samba3.blackbox.rpcclient.pw-nt-hash", "simpleserver",
+              [os.path.join(samba3srcdir, "script/tests/test_rpcclient_pw_nt_hash.sh"),
+               "$USERNAME", "$PASSWORD", "$SERVER",
+               os.path.join(bindir(), "rpcclient")])
+
 options_list = ["", "-e"]
 for options in options_list:
     plantestsuite("samba3.blackbox.smbclient_krb5 old ccache %s" % options, "ktest:local",