[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Thu Dec 11 13:41:02 MST 2014


The branch, master has been updated
       via  0da3ab9 selftest: Add test for joining a Samba classic DC as a BDC
       via  e6ec265 libsmb: Allow change of BDC trust account password
       via  c3b5f9c auth: Allow domain join to itself when we are a PDC
       via  6d6c673 selftest: Add 'net dom join' test which fails cause we are a DC
       via  b299409 netapi: Move DC check to NetJoinDomain() where it is needed.
      from  a12ae81 vfs_glusterfs: Set connectpath as snapdir-entry-path.

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


- Log -----------------------------------------------------------------
commit 0da3ab96739df436b54fcf6c7e138229271b0866
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Oct 23 12:38:15 2014 +1300

    selftest: Add test for joining a Samba classic DC as a BDC
    
    This does not join the DC itself, so as not to pertrub the test
    environment mid-run, but does confirm that the join works and the
    password can be changed.
    
    Pair-programmed-with: Garming Sam <garming at catalyst.net.nz>
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Thu Dec 11 21:40:27 CET 2014 on sn-devel-104

commit e6ec265a405e76e5d4ea59b8025da0f57b3d3ad1
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Oct 23 12:28:48 2014 +1300

    libsmb: Allow change of BDC trust account password
    
    This account is otherwise just like the workstation trust acocunt, so use that code.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10891
    
    Pair-programmed-with: Garming Sam <garming at catalyst.net.nz>
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit c3b5f9cff56defedb0fc1e99fbbb528b1ce22f6d
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Dec 11 15:39:38 2013 +1300

    auth: Allow domain join to itself when we are a PDC
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10891
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 6d6c673c6d33ceb1379c66d6b4d78a52077b928a
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 11 16:41:55 2014 +0100

    selftest: Add 'net dom join' test which fails cause we are a DC
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

commit b299409410751ff3c8c775bd073e34d914a54efc
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Dec 11 14:59:20 2013 +1300

    netapi: Move DC check to NetJoinDomain() where it is needed.
    
    This partially reverts 15f6e27bd5a9065c8b781fa21f5989ce2c355776.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10891
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>

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

Summary of changes:
 source3/lib/netapi/joindomain.c                   |  4 ++++
 source3/libnet/libnet_join.c                      |  8 +++-----
 source3/libsmb/trusts_util.c                      |  3 +++
 source3/script/tests/test_net_dom_join_fail_dc.sh | 22 ++++++++++++++++++++
 source3/script/tests/test_net_rpc_join.sh         | 25 +++++++++++++++++++++++
 source3/selftest/tests.py                         |  9 ++++++++
 6 files changed, 66 insertions(+), 5 deletions(-)
 create mode 100755 source3/script/tests/test_net_dom_join_fail_dc.sh
 create mode 100755 source3/script/tests/test_net_rpc_join.sh


Changeset truncated at 500 lines:

diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c
index 9da1bdc..632c8c6 100644
--- a/source3/lib/netapi/joindomain.c
+++ b/source3/lib/netapi/joindomain.c
@@ -115,6 +115,10 @@ WERROR NetJoinDomain_r(struct libnetapi_ctx *ctx,
 	struct dcerpc_binding_handle *b;
 	DATA_BLOB session_key;
 
+	if (IS_DC) {
+		return WERR_SETUP_DOMAIN_CONTROLLER;
+	}
+
 	werr = libnetapi_open_pipe(ctx, r->in.server,
 				   &ndr_table_wkssvc,
 				   &pipe_cli);
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index 7c70d35..dd87c6d 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -1957,10 +1957,6 @@ static WERROR libnet_join_pre_processing(TALLOC_CTX *mem_ctx,
 		return WERR_INVALID_PARAM;
 	}
 
-	if (IS_DC) {
-		return WERR_SETUP_DOMAIN_CONTROLLER;
-	}
-
 	if (!r->in.admin_domain) {
 		char *admin_domain = NULL;
 		char *admin_account = NULL;
@@ -2143,7 +2139,9 @@ static WERROR libnet_join_check_config(TALLOC_CTX *mem_ctx,
 
 	switch (r->out.domain_is_ad) {
 		case false:
-			valid_security = (lp_security() == SEC_DOMAIN);
+			valid_security = (lp_security() == SEC_DOMAIN)
+				|| (lp_server_role() == ROLE_DOMAIN_PDC)
+				|| (lp_server_role() == ROLE_DOMAIN_BDC);
 			if (valid_workgroup && valid_security) {
 				/* nothing to be done */
 				return WERR_OK;
diff --git a/source3/libsmb/trusts_util.c b/source3/libsmb/trusts_util.c
index bb2e977..7503ef0 100644
--- a/source3/libsmb/trusts_util.c
+++ b/source3/libsmb/trusts_util.c
@@ -111,6 +111,7 @@ NTSTATUS trust_pw_change(struct netlogon_creds_cli_context *context,
 
 	switch (sec_channel_type) {
 	case SEC_CHAN_WKSTA:
+	case SEC_CHAN_BDC:
 		pwd = secrets_fetch_machine_password(domain,
 						     &pass_last_set_time,
 						     NULL);
@@ -188,6 +189,7 @@ NTSTATUS trust_pw_change(struct netlogon_creds_cli_context *context,
 	switch (sec_channel_type) {
 
 	case SEC_CHAN_WKSTA:
+	case SEC_CHAN_BDC:
 		if (!secrets_store_machine_password(new_trust_passwd, domain, sec_channel_type)) {
 			TALLOC_FREE(frame);
 			return NT_STATUS_INTERNAL_DB_CORRUPTION;
@@ -206,6 +208,7 @@ NTSTATUS trust_pw_change(struct netlogon_creds_cli_context *context,
 		break;
 
 	default:
+		smb_panic("Unsupported secure channel type");
 		break;
 	}
 
diff --git a/source3/script/tests/test_net_dom_join_fail_dc.sh b/source3/script/tests/test_net_dom_join_fail_dc.sh
new file mode 100755
index 0000000..135e1da
--- /dev/null
+++ b/source3/script/tests/test_net_dom_join_fail_dc.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+if [ $# -lt 4 ]; then
+cat <<EOF
+Usage: test_net_dom_join_fail_dc.sh  USERNAME PASSWORD DOMAIN PREFIX
+EOF
+exit 1;
+fi
+
+DC_USERNAME="$1"
+DC_PASSWORD="$2"
+DOMAIN="$3"
+PREFIX="$4"
+shift 4
+ADDARGS="$*"
+
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
+mkdir -p $PREFIX/private
+testit_expect_failure "net_dom_join_fail_dc" $VALGRIND $BINDIR/net dom join domain=$DOMAIN account=$USERNAME password=$PASSWORD --option=netbiosname=netrpcjointest --option=domainlogons=yes --option=privatedir=$PREFIX/private $ADDARGS || failed=`expr $failed + 1`
+
+testok $0 $failed
diff --git a/source3/script/tests/test_net_rpc_join.sh b/source3/script/tests/test_net_rpc_join.sh
new file mode 100755
index 0000000..a7810a9
--- /dev/null
+++ b/source3/script/tests/test_net_rpc_join.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+if [ $# -lt 4 ]; then
+cat <<EOF
+Usage: test_net_rpc_join.sh  USERNAME PASSWORD SERVER PREFIX
+EOF
+exit 1;
+fi
+
+USERNAME="$1"
+PASSWORD="$2"
+SERVER="$3"
+PREFIX="$4"
+shift 4
+ADDARGS="$*"
+
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
+mkdir -p $PREFIX/private
+testit "net_rpc_join" $VALGRIND $BINDIR/net rpc join -S $SERVER --option=netbiosname=netrpcjointest --option=domainlogons=yes --option=privatedir=$PREFIX/private -U$USERNAME%$PASSWORD $ADDARGS || failed=`expr $failed + 1`
+testit "net_rpc_testjoin" $VALGRIND $BINDIR/net rpc testjoin -S $SERVER --option=netbiosname=netrpcjointest --option=domainlogons=yes --option=privatedir=$PREFIX/private $ADDARGS || failed=`expr $failed + 1`
+testit "net_rpc_changetrustpw" $VALGRIND $BINDIR/net rpc changetrustpw -S $SERVER --option=netbiosname=netrpcjointest --option=domainlogons=yes --option=privatedir=$PREFIX/private $ADDARGS || failed=`expr $failed + 1`
+testit "net_rpc_testjoin2" $VALGRIND $BINDIR/net rpc testjoin -S $SERVER --option=netbiosname=netrpcjointest --option=domainlogons=yes --option=privatedir=$PREFIX/private $ADDARGS || failed=`expr $failed + 1`
+
+testok $0 $failed
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 40599c3..c60f531 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -411,6 +411,15 @@ for s in signseal_options:
 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])
 
+plantestsuite("samba3.blackbox.net_dom_join_fail_dc", "s3dc",
+              [os.path.join(samba3srcdir, "script/tests/test_net_dom_join_fail_dc.sh"),
+               "$USERNAME", "$PASSWORD", "$SERVER", "$PREFIX/net_dom_join_fail_dc",
+               configuration])
+plantestsuite("samba3.blackbox.net_rpc_join", "s3dc",
+              [os.path.join(samba3srcdir, "script/tests/test_net_rpc_join.sh"),
+               "$USERNAME", "$PASSWORD", "$SERVER", "$PREFIX/net_rpc_join",
+               configuration])
+
 options_list = ["", "-e"]
 for options in options_list:
     plantestsuite("samba3.blackbox.smbclient_krb5 old ccache %s" % options, "ktest:local",


-- 
Samba Shared Repository


More information about the samba-cvs mailing list