[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Mon May 10 04:20:55 MDT 2010


The branch, master has been updated
       via  9469932... s4:dsdb/util.c - Add a new function for retrieving password change attributes
       via  6ee5330... s4:blackbox password tests - more complex passwords
       via  0134784... s4:selftest - change test passwords
       via  47f74c8... s4:selftest: add --socket-wrapper[-keep]-pcap options to "waf test"
      from  f754942... testprogs: update Makefile.mingw (although mingw current cant build it).

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


- Log -----------------------------------------------------------------
commit 946993238fbb0e4920bf3c6c1178236b4f039b3b
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Sun Oct 4 19:30:53 2009 +0200

    s4:dsdb/util.c - Add a new function for retrieving password change attributes
    
    This is needed since we have not only reset operations on password fields
    (attributes marked with REPLACE flag) but also change operations which can be
    performed by users itself. They have one attribute with the old value marked
    with the REMOVE flag and one with the new one marked with the ADD flag.
    This function helps to retrieve them (argument "new" is used for the new
    password on both reset and change).

commit 6ee53309a180d32cf6df1a72fde30c9455d5364d
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat May 8 13:55:09 2010 +0200

    s4:blackbox password tests - more complex passwords

commit 01347844f5b224d567195f5a2e235491b6b174f5
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Wed Sep 30 20:59:42 2009 +0200

    s4:selftest - change test passwords
    
    The passwords need to be more complex to meet the new complexity criteria.

commit 47f74c89c99f6620e9029e87516aceb28f991ed0
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat May 8 13:55:25 2010 +0200

    s4:selftest: add --socket-wrapper[-keep]-pcap options to "waf test"
    
    metze

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

Summary of changes:
 selftest/target/Samba4.pm                   |    6 ++--
 source4/dsdb/common/util.c                  |   41 +++++++++++++++++++++++++++
 source4/selftest/wscript                    |   10 ++++++
 source4/setup/tests/blackbox_newuser.sh     |    4 +-
 source4/setup/tests/blackbox_setpassword.sh |    6 ++--
 5 files changed, 59 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 5680dd8..69add20 100644
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -835,7 +835,7 @@ sub provision_member($$$)
 				   "localmember3",
 				   "localmember",
 				   3,
-				   "localmemberpass",
+				   "locMEMpass0",
 				   $dcvars->{SERVER_IP},
 				   "");
 
@@ -882,7 +882,7 @@ sub provision_rpc_proxy($$$)
 				   "localrpcproxy4",
 				   "localrpcproxy",
 				   4,
-				   "localrpcproxypass",
+				   "locRPCproxypass0",
 				   $dcvars->{SERVER_IP},
 				   $extra_smbconf_options);
 
@@ -917,7 +917,7 @@ sub provision_dc($$)
 				   "localdc1",
 				   "localdc",
 				   1,
-				   "localdcpass",
+				   "locDCpass0",
 				   "127.0.0.1", "");
 
 	$self->add_wins_config("$prefix/private") or 
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 40f0a7f..2948be0 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -722,6 +722,47 @@ struct ldb_message_element *samdb_find_attribute(struct ldb_context *ldb,
 	return NULL;
 }
 
+/*
+ * This is intended for use by the "password hash" module since there
+ * password changes can be specified through one message element with the
+ * new password (to set) and another one with the old password (to unset).
+ *
+ * The first which sets a password (new value) can have flags
+ * (LDB_FLAG_MOD_ADD, LDB_FLAG_MOD_REPLACE) but also none (on "add" operations
+ * for entries). The latter (old value) has always specified
+ * LDB_FLAG_MOD_DELETE.
+ *
+ * Returns LDB_ERR_NO_SUCH_ATTRIBUTE if the attribute which should be deleted
+ * doesn't contain only one value (this is the Windows Server behaviour)
+ * otherwise LDB_SUCCESS.
+ */
+int samdb_msg_find_old_and_new_ldb_val(const struct ldb_message *msg,
+				       const char *name,
+				       const struct ldb_val **new_val,
+				       const struct ldb_val **old_val)
+{
+	unsigned int i;
+
+	*new_val = NULL;
+	*old_val = NULL;
+
+	if (msg == NULL) {
+		return LDB_SUCCESS;
+	}
+
+	for (i = 0; i < msg->num_elements; i++) {
+		if (ldb_attr_cmp(msg->elements[i].name, name) == 0) {
+			if (msg->elements[i].flags == LDB_FLAG_MOD_DELETE) {
+				*old_val = &msg->elements[i].values[0];
+			} else {
+				*new_val = &msg->elements[i].values[0];
+			}
+		}
+	}
+
+	return LDB_SUCCESS;
+}
+
 int samdb_find_or_add_value(struct ldb_context *ldb, struct ldb_message *msg, const char *name, const char *set_value)
 {
 	if (samdb_find_attribute(ldb, msg, name, set_value) == NULL) {
diff --git a/source4/selftest/wscript b/source4/selftest/wscript
index 50c0f52..5e42e6f 100644
--- a/source4/selftest/wscript
+++ b/source4/selftest/wscript
@@ -50,6 +50,12 @@ def set_options(opt):
     gr.add_option('--gdbtest',
                   help=("run the testsuite within a gdb xterm window"),
                   action="store_true", dest='GDBTEST', default=False)
+    gr.add_option('--socket-wrapper-pcap',
+                  help=("create a pcap file for each failing test"),
+                  action="store_true", dest='SOCKET_WRAPPER_PCAP', default=False)
+    gr.add_option('--socket-wrapper-keep-pcap',
+                  help=("create a pcap file for all individual test"),
+                  action="store_true", dest='SOCKET_WRAPPER_KEEP_PCAP', default=False)
 
 def configure(conf):
     conf.env.SELFTEST_PREFIX = Options.options.SELFTEST_PREFIX
@@ -80,6 +86,10 @@ def cmd_testonly(opt):
         env.OPTIONS += ' --load-list=%s' % Options.options.LOAD_LIST
     if Options.options.TESTENV:
         env.OPTIONS += ' --testenv'
+    if Options.options.SOCKET_WRAPPER_PCAP:
+        env.OPTIONS += ' --socket-wrapper-pcap'
+    if Options.options.SOCKET_WRAPPER_KEEP_PCAP:
+        env.OPTIONS += ' --socket-wrapper-keep-pcap'
 
     if os.environ.get('RUN_FROM_BUILD_FARM') is not None:
         env.FILTER_OPTIONS = '${FILTER_XFAIL} --strip-passed-output'
diff --git a/source4/setup/tests/blackbox_newuser.sh b/source4/setup/tests/blackbox_newuser.sh
index 30e6830..113b667 100755
--- a/source4/setup/tests/blackbox_newuser.sh
+++ b/source4/setup/tests/blackbox_newuser.sh
@@ -18,13 +18,13 @@ net="./bin/net"
 
 CONFIG="--configfile=$PREFIX/simple-dc/etc/smb.conf"
 
-testit "newuser" $net newuser $CONFIG testuser testpass
+testit "newuser" $net newuser $CONFIG testuser testp at ssw0Rd
 
 # check the enable account script
 testit "enableaccount" $net enableaccount $CONFIG testuser
 
 # check the enable account script
-testit "setpassword" $net setpassword $CONFIG testuser --newpassword=testpass2
+testit "setpassword" $net setpassword $CONFIG testuser --newpassword=testp at ssw0Rd2
 
 # check the setexpiry script
 testit "noexpiry" $net setexpiry $CONFIG testuser --noexpiry
diff --git a/source4/setup/tests/blackbox_setpassword.sh b/source4/setup/tests/blackbox_setpassword.sh
index 9f8fa6d..039278f 100755
--- a/source4/setup/tests/blackbox_setpassword.sh
+++ b/source4/setup/tests/blackbox_setpassword.sh
@@ -16,11 +16,11 @@ net="./bin/net"
 
 testit "simple-dc" $PYTHON ./setup/provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/simple-dc
 
-testit "newuser" $net newuser --configfile=$PREFIX/simple-dc/etc/smb.conf testuser testpass
+testit "newuser" $net newuser --configfile=$PREFIX/simple-dc/etc/smb.conf testuser testp at ssw0Rd
 
-testit "setpassword" $net setpassword --configfile=$PREFIX/simple-dc/etc/smb.conf testuser --newpassword=testpass
+testit "setpassword" $net setpassword --configfile=$PREFIX/simple-dc/etc/smb.conf testuser --newpassword=testp at ssw0Rd
 
-testit "setpassword" $net setpassword --configfile=$PREFIX/simple-dc/etc/smb.conf testuser --newpassword=testpass --must-change-at-next-login
+testit "setpassword" $net setpassword --configfile=$PREFIX/simple-dc/etc/smb.conf testuser --newpassword=testp at ssw0Rd --must-change-at-next-login
 
 testit "pwsettings" $net pwsettings --quiet set --configfile=$PREFIX/simple-dc/etc/smb.conf --complexity=default --history-length=default --min-pwd-length=default --min-pwd-age=default --max-pwd-age=default
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list