[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Thu Mar 30 02:27:03 UTC 2017


The branch, master has been updated
       via  5f49795 selftest: Define template homedir for 'ad_member' env
       via  2be02fd s3:tests: Add a subsitution test for %D %u %g
      from  bc39fb0 winbindd: Fix password policy for pam authentication

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


- Log -----------------------------------------------------------------
commit 5f4979509950547e68af7f64ac263d0e0705ee03
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Mar 17 10:04:19 2017 +0100

    selftest: Define template homedir for 'ad_member' env
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12699
    
    With this set, the samba3.local.nss test for ad_member will ensure that
    we correctly substitute those smb.conf options.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Mar 30 04:26:18 CEST 2017 on sn-devel-144

commit 2be02fdd1ed1d565e28f50d02ff5216391ac0660
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Mar 15 12:37:08 2017 +0100

    s3:tests: Add a subsitution test for %D %u %g
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12699
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 nsswitch/tests/test_wbinfo.sh              | 17 +++++++++++------
 selftest/target/Samba3.pm                  | 20 +++++++++++++++++++-
 source3/script/tests/test_substitutions.sh |  9 +++++++--
 3 files changed, 37 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/nsswitch/tests/test_wbinfo.sh b/nsswitch/tests/test_wbinfo.sh
index cfe582d..f9c040e 100755
--- a/nsswitch/tests/test_wbinfo.sh
+++ b/nsswitch/tests/test_wbinfo.sh
@@ -205,13 +205,18 @@ subunit_start_test "$test_name"
 # The full name (GECOS) is based on name (the RDN, in this case CN)
 # and displayName in winbindd_ads, and is based only on displayName in
 # winbindd_msrpc and winbindd_rpc.  Allow both versions.
-expected_line="$DOMAIN/administrator:*:$admin_uid:$gid:Administrator:/home/$DOMAIN/administrator:/bin/false"
-expected2_line="$DOMAIN/administrator:*:$admin_uid:$gid::/home/$DOMAIN/administrator:/bin/false"
+if test "$TARGET" = "ad_member"; then
+	expected1_line="$DOMAIN/administrator:*:$admin_uid:$gid:Administrator:/home/$DOMAIN/Domain Users/administrator:/bin/false"
+	expected2_line="$DOMAIN/administrator:*:$admin_uid:$gid::/home/$DOMAIN/Domain Users/administrator:/bin/false"
+else
+	expected1_line="$DOMAIN/administrator:*:$admin_uid:$gid:Administrator:/home/$DOMAIN/administrator:/bin/false"
+	expected2_line="$DOMAIN/administrator:*:$admin_uid:$gid::/home/$DOMAIN/administrator:/bin/false"
+fi
 
-if test x$passwd_line = x"$expected_line" -o x$passwd_line = x"$expected2_line"; then
+if test "x$passwd_line" = "x$expected1_line" -o "x$passwd_line" = "x$expected2_line"; then
 	subunit_pass_test "$test_name"
 else
-	echo "expected '$expected_line' or '$expected2_line' got '$passwd_line'" | subunit_fail_test "$test_name"
+	echo "expected '$expected1_line' or '$expected2_line' got '$passwd_line'" | subunit_fail_test "$test_name"
 	failed=`expr $failed + 1`
 fi
 
@@ -227,10 +232,10 @@ fi
 
 test_name="confirm output of wbinfo --uid-info against $TARGET"
 subunit_start_test "$test_name"
-if test x$passwd_line = x"$expected_line" -o x$passwd_line = x"$expected2_line"; then
+if test "x$passwd_line" = "x$expected1_line" -o "x$passwd_line" = "x$expected2_line"; then
 	subunit_pass_test "$test_name"
 else
-	echo "expected '$expected_line' or '$expected2_line' got '$passwd_line'" | subunit_fail_test "$test_name"
+	echo "expected '$expected1_line' or '$expected2_line' got '$passwd_line'" | subunit_fail_test "$test_name"
 	failed=`expr $failed + 1`
 fi
 
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 354f152..92031a1 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -394,16 +394,34 @@ sub setup_admember($$$$)
 	$substitution_path = "$share_dir/D_SAMBADOMAIN/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";
+	push(@dirs, $substitution_path);
+
+	$substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN/alice";
+	push(@dirs, $substitution_path);
+
+	$substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN/alice/g_SAMBADOMAIN";
+	push(@dirs, $substitution_path);
+
+	$substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN/alice/g_SAMBADOMAIN/domain users";
+	push(@dirs, $substitution_path);
+
 	my $member_options = "
 	security = ads
         workgroup = $dcvars->{DOMAIN}
         realm = $dcvars->{REALM}
         netbios aliases = foo bar
+	template homedir = /home/%D/%G/%U
 
-[subDUG]
+[sub_dug]
 	path = $share_dir/D_%D/U_%U/G_%G
 	writeable = yes
 
+[sub_dug2]
+	path = $share_dir/D_%D/u_%u/g_%g
+	writeable = yes
+
 ";
 
 	my $ret = $self->provision($prefix,
diff --git a/source3/script/tests/test_substitutions.sh b/source3/script/tests/test_substitutions.sh
index 0852ad9..1a46f11 100755
--- a/source3/script/tests/test_substitutions.sh
+++ b/source3/script/tests/test_substitutions.sh
@@ -24,9 +24,14 @@ smbclient="$samba_bindir/smbclient"
 . $samba_srcdir/testprogs/blackbox/subunit.sh
 . $samba_srcdir/testprogs/blackbox/common_test_fns.inc
 
-SMB_UNC="//$SERVER/subDUG"
+SMB_UNC="//$SERVER/sub_dug"
 
-test_smbclient "Test login to share with substitution" \
+test_smbclient "Test login to share with substitution (DUG)" \
+	"ls" "$SMB_UNC" "-U$USERNAME%$PASSWORD" || failed=$(expr $failed + 1)
+
+SMB_UNC="//$SERVER/sub_dug2"
+
+test_smbclient "Test login to share with substitution (Dug)" \
 	"ls" "$SMB_UNC" "-U$USERNAME%$PASSWORD" || failed=$(expr $failed + 1)
 
 exit $failed


-- 
Samba Shared Repository



More information about the samba-cvs mailing list