[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Wed Jun 14 00:54:02 UTC 2017


The branch, master has been updated
       via  ee77759 selftest: pass the workgroup name to Samba3::provision()
       via  1e33a4f testprogs/blackbox: don't use hardcoded values in test_net_ads_dns.sh
       via  5715f74 s3:script/tests: don't use hardcoded Domain Name in test_smbclient_s3.sh
       via  9df4290 selftest: don't use hardcoded domain names in Samba3::setup_admember()
       via  6355473 selftest: test pam_winbind with a local user on ad_member
       via  91b36e0 selftest: use "$DC_USERNAME" and "$DC_PASSWORD" for the pam_winbind test
       via  0eb99bd python/samba/tests: don't use hardcoded names in *pam_winbind* tests
       via  ba4cabb python: Port simple libpython module to Python 3 compatible form
      from  aa74d6e WHATSNEW: deprecated "profile acls"

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


- Log -----------------------------------------------------------------
commit ee77759ed5aa8400ca30892efcca79a22911b50d
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat Jun 10 12:29:47 2017 +0200

    selftest: pass the workgroup name to Samba3::provision()
    
    Not all environments should use the samba workgroup name.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Wed Jun 14 02:53:27 CEST 2017 on sn-devel-144

commit 1e33a4f2114fbfd350bb57822ffd376c431ec61f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jun 12 16:02:32 2017 +0200

    testprogs/blackbox: don't use hardcoded values in test_net_ads_dns.sh
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 5715f74e445f32ce1d97b7e0c3b9e61ddc43973d
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sun Jun 11 23:40:34 2017 +0200

    s3:script/tests: don't use hardcoded Domain Name in test_smbclient_s3.sh
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 9df42902029f1eb6b1050200ccbda7673b72e202
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jun 9 14:53:40 2017 +0200

    selftest: don't use hardcoded domain names in Samba3::setup_admember()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 6355473fabb280a5d10650cecf3b4d9851d21b5d
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jun 9 15:45:25 2017 +0200

    selftest: test pam_winbind with a local user on ad_member
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 91b36e0c0d2c985a5b1a95743fc3ccff13e960b8
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jun 9 15:15:15 2017 +0200

    selftest: use "$DC_USERNAME" and "$DC_PASSWORD" for the pam_winbind test
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 0eb99bd9884c6dc0073fe4ab9074b99519c2594e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jun 9 14:52:59 2017 +0200

    python/samba/tests: don't use hardcoded names in *pam_winbind* tests
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit ba4cabb74f9abf834ee50364fba98ba8c3e9dee3
Author: Lumir Balhar <lbalhar at redhat.com>
Date:   Thu Apr 20 15:11:58 2017 +0200

    python: Port simple libpython module to Python 3 compatible form
    
    Signed-off-by: Lumir Balhar <lbalhar at redhat.com>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

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

Summary of changes:
 python/modules.c                          |  3 ++-
 python/samba/tests/pam_winbind.py         | 15 ++++++++----
 python/samba/tests/test_pam_winbind.sh    |  8 +++++++
 python/wscript                            | 17 +++++++-------
 selftest/target/Samba3.pm                 | 39 +++++++++++++++----------------
 selftest/tests.py                         | 10 ++++++--
 source3/script/tests/test_smbclient_s3.sh |  4 ++--
 testprogs/blackbox/test_net_ads_dns.sh    | 10 +++++---
 8 files changed, 66 insertions(+), 40 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/modules.c b/python/modules.c
index 371f0d5..5db3dd3 100644
--- a/python/modules.c
+++ b/python/modules.c
@@ -18,13 +18,14 @@
 */
 
 #include <Python.h>
+#include "py3compat.h"
 #include "includes.h"
 #include "python/modules.h"
 #include "dynconfig/dynconfig.h"
 
 static bool PySys_PathPrepend(PyObject *list, const char *path)
 {
-	PyObject *py_path = PyString_FromString(path);
+	PyObject *py_path = PyStr_FromString(path);
 	if (py_path == NULL)
 		return false;
 
diff --git a/python/samba/tests/pam_winbind.py b/python/samba/tests/pam_winbind.py
index 21ea2fb..1054e86 100644
--- a/python/samba/tests/pam_winbind.py
+++ b/python/samba/tests/pam_winbind.py
@@ -18,22 +18,29 @@
 
 import samba.tests
 import pypamtest
+import os
 
 class SimplePamTests(samba.tests.TestCase):
     def test_authenticate(self):
-        alice_password = "Secret007"
+        domain = os.environ["DOMAIN"]
+        username = os.environ["USERNAME"]
+        password = os.environ["PASSWORD"]
+        unix_username = "%s/%s" % (domain, username)
         expected_rc = 0 # PAM_SUCCESS
 
         tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
-        res = pypamtest.run_pamtest("SAMBADOMAIN/alice", "samba", [tc], [alice_password])
+        res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
 
         self.assertTrue(res != None)
 
     def test_authenticate_error(self):
-        alice_password = "WrongPassword"
+        domain = os.environ["DOMAIN"]
+        username = os.environ["USERNAME"]
+        password = "WrongPassword"
+        unix_username = "%s/%s" % (domain, username)
         expected_rc = 7 # PAM_AUTH_ERR
 
         tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
-        res = pypamtest.run_pamtest("SAMBADOMAIN/alice", "samba", [tc], [alice_password])
+        res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
 
         self.assertTrue(res != None)
diff --git a/python/samba/tests/test_pam_winbind.sh b/python/samba/tests/test_pam_winbind.sh
index bf59296..fdd2870 100755
--- a/python/samba/tests/test_pam_winbind.sh
+++ b/python/samba/tests/test_pam_winbind.sh
@@ -4,6 +4,14 @@ PYTHON="$1"
 PAM_WRAPPER_SO_PATH="$2"
 shift 2
 
+DOMAIN="$1"
+export DOMAIN
+USERNAME="$2"
+export USERNAME
+PASSWORD="$3"
+export PASSWORD
+shift 3
+
 PAM_WRAPPER_PATH="$BINDIR/default/lib/pam_wrapper"
 
 pam_winbind="$BINDIR/shared/pam_winbind.so"
diff --git a/python/wscript b/python/wscript
index 623ca44..211fac4 100644
--- a/python/wscript
+++ b/python/wscript
@@ -51,17 +51,10 @@ def build(bld):
                       pyembed=True,
                       enabled=bld.PYTHON_BUILD_IS_ENABLED())
 
-    bld.SAMBA_SUBSYSTEM('LIBPYTHON',
-                        source='modules.c',
-                        public_deps='',
-                        init_function_sentinel='{NULL,NULL}',
-                        deps='talloc',
-                        pyext=True,
-                        enabled=bld.PYTHON_BUILD_IS_ENABLED())
-
     for env in bld.gen_python_environments():
         pytalloc_util = bld.pyembed_libname('pytalloc-util')
         pyparam_util = bld.pyembed_libname('pyparam_util')
+        libpython = bld.pyembed_libname('LIBPYTHON')
 
         bld.SAMBA_PYTHON('python_glue',
                          source='pyglue.c',
@@ -73,6 +66,14 @@ def build(bld):
                               ''' % (pyparam_util, pytalloc_util),
                          realname='samba/_glue.so')
 
+        bld.SAMBA_SUBSYSTEM(libpython,
+                            source='modules.c',
+                            public_deps='',
+                            init_function_sentinel='{NULL,NULL}',
+                            deps='talloc',
+                            pyext=True,
+                            enabled=bld.PYTHON_BUILD_IS_ENABLED())
+
     if bld.PYTHON_BUILD_IS_ENABLED():
         for env in bld.gen_python_environments():
             # install out various python scripts for use by make test
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 0914aff..d93d98e 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -231,7 +231,7 @@ sub setup_nt4_dc($$)
 	fss: sequence timeout = 1
 ";
 
-	my $vars = $self->provision($path,
+	my $vars = $self->provision($path, "SAMBA-TEST",
 				    "LOCALNT4DC2",
 				    "localntdc2pass",
 				    $nt4_dc_options);
@@ -279,7 +279,7 @@ sub setup_nt4_dc_schannel($$)
 	server schannel = yes
 ";
 
-	my $vars = $self->provision($path,
+	my $vars = $self->provision($path, "NT4SCHANNEL",
 				    "LOCALNT4DC9",
 				    "localntdc9pass",
 				    $pdc_options);
@@ -318,7 +318,7 @@ sub setup_nt4_member($$$)
 	dbwrap_tdb_mutexes:* = yes
 	${require_mutexes}
 ";
-	my $ret = $self->provision($prefix,
+	my $ret = $self->provision($prefix, $nt4_dc_vars->{DOMAIN},
 				   "LOCALNT4MEMBER3",
 				   "localnt4member3pass",
 				   $member_options);
@@ -385,26 +385,26 @@ sub setup_admember($$$$)
 	my $share_dir="$prefix_abs/share";
 	push(@dirs, $share_dir);
 
-	my $substitution_path = "$share_dir/D_SAMBADOMAIN";
+	my $substitution_path = "$share_dir/D_$dcvars->{DOMAIN}";
 	push(@dirs, $substitution_path);
 
-	$substitution_path = "$share_dir/D_SAMBADOMAIN/U_alice";
+	$substitution_path = "$share_dir/D_$dcvars->{DOMAIN}/U_alice";
 	push(@dirs, $substitution_path);
 
-	$substitution_path = "$share_dir/D_SAMBADOMAIN/U_alice/G_domain users";
+	$substitution_path = "$share_dir/D_$dcvars->{DOMAIN}/U_alice/G_domain users";
 	push(@dirs, $substitution_path);
 
 	# Using '/' as the winbind separator is a bad idea ...
-	$substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN";
+	$substitution_path = "$share_dir/D_$dcvars->{DOMAIN}/u_$dcvars->{DOMAIN}";
 	push(@dirs, $substitution_path);
 
-	$substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN/alice";
+	$substitution_path = "$share_dir/D_$dcvars->{DOMAIN}/u_$dcvars->{DOMAIN}/alice";
 	push(@dirs, $substitution_path);
 
-	$substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN/alice/g_SAMBADOMAIN";
+	$substitution_path = "$share_dir/D_$dcvars->{DOMAIN}/u_$dcvars->{DOMAIN}/alice/g_$dcvars->{DOMAIN}";
 	push(@dirs, $substitution_path);
 
-	$substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN/alice/g_SAMBADOMAIN/domain users";
+	$substitution_path = "$share_dir/D_$dcvars->{DOMAIN}/u_$dcvars->{DOMAIN}/alice/g_$dcvars->{DOMAIN}/domain users";
 	push(@dirs, $substitution_path);
 
 	my $member_options = "
@@ -424,7 +424,7 @@ sub setup_admember($$$$)
 
 ";
 
-	my $ret = $self->provision($prefix,
+	my $ret = $self->provision($prefix, $dcvars->{DOMAIN},
 				   "LOCALADMEMBER",
 				   "loCalMemberPass",
 				   $member_options,
@@ -519,7 +519,7 @@ sub setup_admember_rfc2307($$$$)
         idmap config $dcvars->{DOMAIN} : bind_path_group = ou=idmap,dc=samba,dc=example,dc=com
 ";
 
-	my $ret = $self->provision($prefix,
+	my $ret = $self->provision($prefix, $dcvars->{DOMAIN},
 				   "RFC2307MEMBER",
 				   "loCalMemberPass",
 				   $member_options,
@@ -607,7 +607,7 @@ sub setup_ad_member_idmap_rid($$$$)
 	idmap config $dcvars->{DOMAIN} : range = 2000000-2999999
 ";
 
-	my $ret = $self->provision($prefix,
+	my $ret = $self->provision($prefix, $dcvars->{DOMAIN},
 				   "IDMAPRIDMEMBER",
 				   "loCalMemberPass",
 				   $member_options,
@@ -712,7 +712,7 @@ sub setup_simpleserver($$)
 	smb encrypt = desired
 ";
 
-	my $vars = $self->provision($path,
+	my $vars = $self->provision($path, "WORKGROUP",
 				    "LOCALSHARE4",
 				    "local4pass",
 				    $simpleserver_options);
@@ -822,7 +822,7 @@ sub setup_fileserver($$)
 	acl_xattr:ignore system acls = yes
 ";
 
-	my $vars = $self->provision($path,
+	my $vars = $self->provision($path, "WORKGROUP",
 				    "FILESERVER",
 				    "fileserver",
 				    $fileserver_options,
@@ -909,7 +909,7 @@ sub setup_ktest($$$)
 	client max protocol = SMB3
 ";
 
-	my $ret = $self->provision($prefix,
+	my $ret = $self->provision($prefix, "KTEST",
 				   "LOCALKTEST6",
 				   "localktest6pass",
 				   $ktest_options);
@@ -999,7 +999,7 @@ map to guest = bad user
 ntlm auth = yes
 ";
 
-	my $vars = $self->provision($path,
+	my $vars = $self->provision($path, "WORKGROUP",
 				    "maptoguest",
 				    "maptoguestpass",
 				    $options);
@@ -1262,9 +1262,9 @@ sub createuser($$$$)
 	}
 }
 
-sub provision($$$$$$$$)
+sub provision($$$$$$$$$)
 {
-	my ($self, $prefix, $server, $password, $extra_options, $dc_server_ip, $dc_server_ipv6, $no_delete_prefix) = @_;
+	my ($self, $prefix, $domain, $server, $password, $extra_options, $dc_server_ip, $dc_server_ipv6, $no_delete_prefix) = @_;
 
 	##
 	## setup the various environment variables we need
@@ -1274,7 +1274,6 @@ sub provision($$$$$$$$)
 	my %ret = ();
 	my $server_ip = "127.0.0.$swiface";
 	my $server_ipv6 = sprintf("fd00:0000:0000:0000:0000:0000:5357:5f%02x", $swiface);
-	my $domain = "SAMBA-TEST";
 
 	my $unix_name = ($ENV{USER} or $ENV{LOGNAME} or `PATH=/usr/ucb:$ENV{PATH} whoami`);
 	chomp $unix_name;
diff --git a/selftest/tests.py b/selftest/tests.py
index 5367fe3..175b56c 100644
--- a/selftest/tests.py
+++ b/selftest/tests.py
@@ -139,8 +139,14 @@ plantestsuite(
 planpythontestsuite("none", "samba.tests.glue", py3_compatible=True)
 
 if with_pam:
-    plantestsuite("samba.tests.pam_winbind", "ad_member",
-                  [os.path.join(srcdir(), "python/samba/tests/test_pam_winbind.sh"), valgrindify(python), pam_wrapper_so_path])
+    plantestsuite("samba.tests.pam_winbind(local)", "ad_member",
+                  [os.path.join(srcdir(), "python/samba/tests/test_pam_winbind.sh"),
+                   valgrindify(python), pam_wrapper_so_path,
+                   "$SERVER", "$USERNAME", "$PASSWORD"])
+    plantestsuite("samba.tests.pam_winbind(domain)", "ad_member",
+                  [os.path.join(srcdir(), "python/samba/tests/test_pam_winbind.sh"),
+                   valgrindify(python), pam_wrapper_so_path,
+                   "$DOMAIN", "$DC_USERNAME", "$DC_PASSWORD"])
 
 if with_cmocka:
     plantestsuite("samba.unittests.krb5samba", "none",
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
index 1359ed2..17ef938 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -1232,11 +1232,11 @@ EOF
        return
     fi
 
-    echo "$out" | grep 'Domain=\[SAMBA.*\] OS=\[Windows [0-9]\.[0-9]\] Server=\[Samba'
+    echo "$out" | grep "Domain=\[[a-zA-Z][a-zA-Z0-9.-]*\] OS=\[Windows [0-9]\.[0-9]\] Server=\[Samba"
     ret=$?
     if [ $ret -ne 0 ] ; then
        echo "$out"
-       echo "failed - should get: Domain=[SAMBA-TEST] OS=[Windows 6.1] Server=..."
+       echo "failed - should get: Domain=[...] OS=[Windows 6.1] Server=..."
        false
        return
     fi
diff --git a/testprogs/blackbox/test_net_ads_dns.sh b/testprogs/blackbox/test_net_ads_dns.sh
index 8f9a91b..d3b1e79 100755
--- a/testprogs/blackbox/test_net_ads_dns.sh
+++ b/testprogs/blackbox/test_net_ads_dns.sh
@@ -3,7 +3,7 @@
 # Copyright (C) 2006-2007 Jelmer Vernooij <jelmer at samba.org>
 # Copyright (C) 2006-2008 Andrew Bartlett <abartlet at samba.org>
 
-if [ $# -lt 4 ]; then
+if [ $# -lt 6 ]; then
 cat <<EOF
 Usage: test_net_ads_dns.sh SERVER DC_USERNAME DC_PASSWORD REALM USER PASS
 EOF
@@ -33,6 +33,8 @@ samba4kpasswd=kpasswd
 if test -x $BINDIR/samba4kpasswd; then
 	samba4kpasswd=$BINDIR/samba4kpasswd
 fi
+ldbsearch="$samba4bindir/ldbsearch"
+ldbmodify="$samba4bindir/ldbmodify"
 
 newuser="$samba_tool user create"
 groupaddmem="$samba_tool group addmembers"
@@ -69,9 +71,11 @@ testit "The name $NAME.$REALM should not be there any longer" test X"`$net_tool
 # This should be an expect_failure test ...
 testit "Adding an unprivileged user" $VALGRIND $net_tool user add $UNPRIVUSER $UNPRIVPASS -U$DC_USERNAME%$DC_PASSWORD || failed=`expr $failed + 1`
 
-LDIF="dn: CN=$UNPRIVUSER,CN=users,DC=samba,DC=example,DC=com+changetype: modify+replace: userAccountControl+userAccountControl: 512"
+BASEDN=$($VALGRIND $ldbsearch -U$DC_USERNAME%$DC_PASSWORD -H ldap://$SERVER.$REALM -b '' -s base defaultNamingContext | grep defaultNamingContext | sed -e 's!^defaultNamingContext: !!')
 
-echo $LDIF | tr '+' '\n' | ./bin/ldbmodify -Uadministrator%locDCpass1 -H ldap://localdc.samba.example.com -i
+LDIF="dn: CN=$UNPRIVUSER,CN=users,${BASEDN}+changetype: modify+replace: userAccountControl+userAccountControl: 512"
+
+echo $LDIF | tr '+' '\n' | $VALGRIND $ldbmodify -U$DC_USERNAME%$DC_PASSWORD -H ldap://$SERVER.$REALM -i
 STATUS=$?
 
 testit "We should have enabled the account" test $STATUS -eq 0 || failed=`expr $failed + 1`


-- 
Samba Shared Repository



More information about the samba-cvs mailing list