The branch, v4-4-test has been updated
       via  8f142c8 s3:selftest add a test for rpcclient --pw-nt-hash option
       via  2f579c7 s3:rpcclient make --pw-nt-hash option work
      from  3454590 s3-smbd: Support systemd 230

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-4-test


- Log -----------------------------------------------------------------
commit 8f142c8a0e7545e55fed56290c06c21838bd7d11
Author: Christian Ambach <[email protected]>
Date:   Wed May 11 19:21:20 2016 +0200

    s3:selftest add a test for rpcclient --pw-nt-hash option
    
    Signed-off-by: Christian Ambach <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    (cherry picked from commit d0cdf02dc9733dae960021ff1ca07587d8155e58)
    
    Autobuild-User(v4-4-test): Karolin Seeger <[email protected]>
    Autobuild-Date(v4-4-test): Tue May 31 16:49:03 CEST 2016 on sn-devel-144

commit 2f579c7b40738e23691f28eb1611427708ef8258
Author: Christian Ambach <[email protected]>
Date:   Wed May 11 17:41:24 2016 +0200

    s3:rpcclient make --pw-nt-hash option work
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10796
    
    Signed-off-by: Christian Ambach <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    (cherry picked from commit 4fe59879cc2a608194578e33e27e0dc1e2f0fc58)

-----------------------------------------------------------------------

Summary of changes:
 source3/rpcclient/rpcclient.c                     |  3 +++
 source3/script/tests/test_rpcclient_pw_nt_hash.sh | 27 +++++++++++++++++++++++
 source3/selftest/tests.py                         |  5 +++++
 3 files changed, 35 insertions(+)
 create mode 100755 source3/script/tests/test_rpcclient_pw_nt_hash.sh


Changeset truncated at 500 lines:

diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index a4edbe8..74ae708 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -1095,6 +1095,9 @@ out_free:
        if (get_cmdline_auth_info_use_ccache(rpcclient_auth_info)) {
                flags |= CLI_FULL_CONNECTION_USE_CCACHE;
        }
+       if (get_cmdline_auth_info_use_pw_nt_hash(rpcclient_auth_info)) {
+               flags |= CLI_FULL_CONNECTION_USE_NT_HASH;
+       }
 
        user = talloc_strdup(frame, 
get_cmdline_auth_info_username(rpcclient_auth_info));
        SMB_ASSERT(user != NULL);
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
index 0000000..c03d22f
--- /dev/null
+++ b/source3/script/tests/test_rpcclient_pw_nt_hash.sh
@@ -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
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index ce26212..753cff6 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -461,6 +461,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",


-- 
Samba Shared Repository

Reply via email to