[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Mon Dec 23 09:18:04 MST 2013


The branch, master has been updated
       via  819e1f5 selftest: add rodc and other env tests for wbinfo
       via  48820b9 selftest: add new credential change test
       via  2fae806 s3:rpcclient: close the connection if setting up the netlogon secure channel fails
       via  0e46205 selftest: add new rpc client test
       via  ae67201 s3:rpc_server: use make_session_info_guest() directly
      from  ec790f8 libgpo: remove unused process_group_policy2 callback from CSE module API.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 819e1f561df5074ae21db77c6558b34f4b0e1351
Author: Garming Sam <garming at catalyst.net.nz>
Date:   Mon Dec 23 17:12:39 2013 +1300

    selftest: add rodc and other env tests for wbinfo
    
    Pair-programmed-with: Andrew Bartlett <abartlet at samba.org>
    Signed-off-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Mon Dec 23 17:17:39 CET 2013 on sn-devel-104

commit 48820b95285f7dffd827143ba56f432f3e283a6f
Author: Garming Sam <garming at catalyst.net.nz>
Date:   Mon Dec 2 13:20:39 2013 +1300

    selftest: add new credential change test
    
    Signed-off-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 2fae806550f3355298541a344b217bf810bf92e4
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Nov 29 08:45:38 2013 +0100

    s3:rpcclient: close the connection if setting up the netlogon secure channel fails
    
    This is based on a patch from  Garming Sam <garming at catalyst.net.nz>.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 0e46205ff83d137ca486868e4376b258b6dfa1a2
Author: Garming Sam <garming at catalyst.net.nz>
Date:   Fri Nov 29 16:51:08 2013 +1300

    selftest: add new rpc client test
    
    Pair-programmed-with: Andrew Bartlett <abartlet at samba.org>
    
    Signed-off-by: Garming Sam <garming at catalyst.net.nz>
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit ae6720117ae5fb3c922486ce46e2b0d51e020301
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Nov 29 09:46:01 2013 +0100

    s3:rpc_server: use make_session_info_guest() directly
    
    This removes the useless static auth_anonymous_session_info() wrapper.
    
    auth_anonymous_session_info() is also a public function in source4.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

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

Summary of changes:
 source3/rpc_server/rpc_server.c                 |   22 +++++-------------
 source3/rpcclient/rpcclient.c                   |    5 ++++
 source3/script/tests/test_net_cred_change.sh    |   16 +++++++++++++
 source3/script/tests/test_rpcclient_samlogon.sh |   27 +++++++++++++++++++++++
 source3/selftest/tests.py                       |    5 ++++
 source4/selftest/tests.py                       |    4 +-
 6 files changed, 61 insertions(+), 18 deletions(-)
 create mode 100755 source3/script/tests/test_net_cred_change.sh
 create mode 100755 source3/script/tests/test_rpcclient_samlogon.sh


Changeset truncated at 500 lines:

diff --git a/source3/rpc_server/rpc_server.c b/source3/rpc_server/rpc_server.c
index d10d3ac..58c16c0 100644
--- a/source3/rpc_server/rpc_server.c
+++ b/source3/rpc_server/rpc_server.c
@@ -37,19 +37,6 @@
 #define SERVER_TCP_LOW_PORT  1024
 #define SERVER_TCP_HIGH_PORT 1300
 
-static NTSTATUS auth_anonymous_session_info(TALLOC_CTX *mem_ctx,
-					    struct auth_session_info **session_info)
-{
-	NTSTATUS status;
-
-	status = make_session_info_guest(mem_ctx, session_info);
-	if (!NT_STATUS_IS_OK(status)) {
-		return status;
-	}
-
-	return NT_STATUS_OK;
-}
-
 /* Creates a pipes_struct and initializes it with the information
  * sent from the client */
 int make_server_pipes_struct(TALLOC_CTX *mem_ctx,
@@ -1068,11 +1055,14 @@ void dcerpc_ncacn_accept(struct tevent_context *ev_ctx,
 	}
 
 	if (ncacn_conn->session_info == NULL) {
-		status = auth_anonymous_session_info(ncacn_conn,
-						     &ncacn_conn->session_info);
+		/*
+		 * TODO: use auth_anonymous_session_info() here?
+		 */
+		status = make_session_info_guest(ncacn_conn,
+						 &ncacn_conn->session_info);
 		if (!NT_STATUS_IS_OK(status)) {
 			DEBUG(2, ("Failed to create "
-				  "auth_anonymous_session_info - %s\n",
+				  "make_session_info_guest - %s\n",
 				  nt_errstr(status)));
 			talloc_free(ncacn_conn);
 			return;
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index c88e6b3..eae6bbd 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -769,6 +769,10 @@ static NTSTATUS do_cmd(struct cli_state *cli,
 					       trust_password, &machine_account,
 					       &sec_channel_type))
 			{
+				DEBUG(0, ("Failed to fetch trust password for %s to connect to %s.\n",
+					  get_cmdline_auth_info_domain(auth_info),
+					  cmd_entry->table->name));
+				TALLOC_FREE(cmd_entry->rpc_pipe);
 				talloc_free(mem_ctx);
 				return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;
 			}
@@ -785,6 +789,7 @@ static NTSTATUS do_cmd(struct cli_state *cli,
 			if (!NT_STATUS_IS_OK(ntresult)) {
 				DEBUG(0, ("Could not initialise credentials for %s.\n",
 					  cmd_entry->table->name));
+				TALLOC_FREE(cmd_entry->rpc_pipe);
 				talloc_free(mem_ctx);
 				return ntresult;
 			}
diff --git a/source3/script/tests/test_net_cred_change.sh b/source3/script/tests/test_net_cred_change.sh
new file mode 100755
index 0000000..9013d07
--- /dev/null
+++ b/source3/script/tests/test_net_cred_change.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+if [ $# -lt 1 ]; then
+cat <<EOF
+Usage: test_net_cred_change.sh CONFIGURATION
+EOF
+exit 1;
+fi
+
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
+testit "first change" $VALGRIND $BINDIR/wbinfo -c || failed =`expr $failed + 1`
+testit "first join" $VALGRIND $BINDIR/net rpc testjoin $@ || failed =`expr $failed + 1`
+testit "second change" $VALGRIND $BINDIR/wbinfo -c || failed =`expr $failed + 1`
+
+testok $0 $failed
diff --git a/source3/script/tests/test_rpcclient_samlogon.sh b/source3/script/tests/test_rpcclient_samlogon.sh
new file mode 100755
index 0000000..01af7f8
--- /dev/null
+++ b/source3/script/tests/test_rpcclient_samlogon.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+if [ $# -lt 3 ]; then
+cat <<EOF
+Usage: test_rpcclient_samlogon.sh USERNAME PASSWORD binding <rpcclient commands>
+EOF
+exit 1;
+fi
+
+USERNAME="$1"
+PASSWORD="$2"
+shift 2
+ADDARGS="$*"
+
+rpcclient_samlogon()
+{
+	$VALGRIND $BINDIR/rpcclient -U% -c "samlogon $USERNAME $PASSWORD;samlogon $USERNAME $PASSWORD" $@
+}
+
+
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
+testit "rpcclient dsenumdomtrusts" $VALGRIND $BINDIR/rpcclient $ADDARGS -U% -c "dsenumdomtrusts" || failed=`expr $failed + 1`
+testit "rpcclient getdcsitecoverage" $VALGRIND $BINDIR/rpcclient $ADDARGS -U% -c "getdcsitecoverage" || failed=`expr $failed + 1`
+testit "rpcclient samlogon" rpcclient_samlogon $ADDARGS || failed=`expr $failed +1`
+
+testok $0 $failed
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index b642585..254e942 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -167,6 +167,9 @@ for env in ["s3dc", "member", "s3member"]:
 
     plantestsuite("samba3.ntlm_auth.(%s:local)" % env, "%s:local" % env, [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_s3.sh"), valgrindify(python), samba3srcdir, ntlm_auth3,  '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', configuration])
 
+for env in ["member", "s3member"]:
+    plantestsuite("samba3.blackbox.net_cred_change.(%s:local)" % env, "%s:local" % env, [os.path.join(samba3srcdir, "script/tests/test_net_cred_change.sh"), configuration])
+
 env = "s3member"
 t = "--krb5auth=$DOMAIN\\\\$DC_USERNAME%$DC_PASSWORD"
 plantestsuite("samba3.wbinfo_s3.(%s:local).%s" % (env, t), "%s:local" % env, [os.path.join(samba3srcdir, "script/tests/test_wbinfo_s3.sh"), t])
@@ -395,6 +398,8 @@ for s in signseal_options:
         plantestsuite("samba3.blackbox.rpcclient krb5 ncacn_np with [%s%s%s] " % (a, s, e), "ktest:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient.sh"),
                                                                                                                               "$PREFIX/ktest/krb5_ccache-3", binding_string, "-k", configuration])
 
+plantestsuite("samba3.blackbox.rpcclient_samlogon", "s3member:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient_samlogon.sh"),
+								       "$DC_USERNAME", "$DC_PASSWORD", "ncacn_np:$DC_SERVER", configuration])
 
 options_list = ["", "-e"]
 for options in options_list:
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index e738d1d..c3a33c7 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -309,8 +309,8 @@ plantestsuite("samba4.blackbox.locktest(dc)", "dc", [os.path.join(samba4srcdir,
 plantestsuite("samba4.blackbox.masktest", "dc", [os.path.join(samba4srcdir, "torture/tests/test_masktest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', '$PREFIX'])
 plantestsuite("samba4.blackbox.gentest(dc)", "dc", [os.path.join(samba4srcdir, "torture/tests/test_gentest.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$DOMAIN', "$PREFIX"])
 plantestsuite("samba4.blackbox.rfc2307_mapping(dc:local)", "dc:local", [os.path.join(samba4srcdir, "../nsswitch/tests/test_rfc2307_mapping.sh"), '$DOMAIN', '$USERNAME', '$PASSWORD', "$SERVER", "$UID_RFC2307TEST", "$GID_RFC2307TEST", configuration])
-plantestsuite("samba4.blackbox.wbinfo(dc:local)", "dc:local", [os.path.join(samba4srcdir, "../nsswitch/tests/test_wbinfo.sh"), '$DOMAIN', '$USERNAME', '$PASSWORD', "dc"])
-plantestsuite("samba4.blackbox.wbinfo(s4member:local)", "s4member:local", [os.path.join(samba4srcdir, "../nsswitch/tests/test_wbinfo.sh"), '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', "s4member"])
+for env in ["dc", "s4member", "rodc", "promoted_dc"]:
+    plantestsuite("samba4.blackbox.wbinfo(%s:local)" % env, "%s:local" % env, [os.path.join(samba4srcdir, "../nsswitch/tests/test_wbinfo.sh"), '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', env])
 plantestsuite("samba4.blackbox.chgdcpass", "chgdcpass", [os.path.join(bbdir, "test_chgdcpass.sh"), '$SERVER', "CHGDCPASS\$", '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", '$SELFTEST_PREFIX/chgdcpass', smbclient4])
 plantestsuite("samba4.blackbox.samba_upgradedns(chgdcpass:local)", "chgdcpass:local", [os.path.join(bbdir, "test_samba_upgradedns.sh"), '$SERVER', '$REALM', '$PREFIX', '$SELFTEST_PREFIX/chgdcpass'])
 plantestsuite_loadlist("samba4.rpc.echo against NetBIOS alias", "dc", [valgrindify(smbtorture4), "$LISTOPT", 'ncacn_np:$NETBIOSALIAS', '-U$DOMAIN/$USERNAME%$PASSWORD', 'rpc.echo'])


-- 
Samba Shared Repository


More information about the samba-cvs mailing list