[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-1396-g65541ba

Matthias Dieter Wallnöfer mdw at samba.org
Sun Sep 6 04:32:47 MDT 2009


The branch, master has been updated
       via  65541baf4b82b89a139744244f27a8c9d0b37701 (commit)
       via  f82dd192ee4cc16271ee91b79ffeecc5284ed0a3 (commit)
       via  ae8e5b48e7206993d22f06953b0dce5bb70decc0 (commit)
       via  89d40419d5c38364e7e88c873c1f83f270357756 (commit)
       via  3694160ad91cc4aac5a47f7a2d920e37432db145 (commit)
       via  6677eea3b1d2c352fda6d8de5f8a41e8a313156a (commit)
       via  43cfa69945c121b6929512a2ea607b2c3bfe0a74 (commit)
      from  e6cb98e53a25af5fba2dc579ff6a51653183eb70 (commit)

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


- Log -----------------------------------------------------------------
commit 65541baf4b82b89a139744244f27a8c9d0b37701
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Sun Sep 6 12:10:16 2009 +0200

    s4:torture - Fix uninitialized variable

commit f82dd192ee4cc16271ee91b79ffeecc5284ed0a3
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Wed Aug 26 07:20:27 2009 +0200

    s4:"linked attributes" modules - correct the comments

commit ae8e5b48e7206993d22f06953b0dce5bb70decc0
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Wed Aug 26 05:17:40 2009 +0200

    s4: Fix typo

commit 89d40419d5c38364e7e88c873c1f83f270357756
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Wed Aug 26 01:33:21 2009 +0200

    s4:pwsettings - Introduce the LDB modify flags in the right way
    
    We can't emulate them through the LDB changetype flags since they haven't the
    same constants! The previous behaviour led to huge problems.

commit 3694160ad91cc4aac5a47f7a2d920e37432db145
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Wed Aug 26 01:01:07 2009 +0200

    s4:ldb_errors - add spaces

commit 6677eea3b1d2c352fda6d8de5f8a41e8a313156a
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Wed Aug 19 11:58:42 2009 +0200

    s4:dsdb/common/util.c - Copy parameters to prevent segfaults
    
    The parameters "lmNewHash" and/or "ntNewHash" could be NULL and when we perform
    write operations on them (look below in the code) we could get SIGSEGVs!

commit 43cfa69945c121b6929512a2ea607b2c3bfe0a74
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Wed Aug 19 08:59:58 2009 +0200

    s4:dsdb/common/util - Indentation fixes

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

Summary of changes:
 source4/dsdb/common/util.c                         |   20 +++++++----
 source4/dsdb/samdb/ldb_modules/linked_attributes.c |    4 +-
 source4/lib/ldb/include/ldb_errors.h               |    2 +
 source4/lib/ldb/modules/asq.c                      |    4 +-
 source4/setup/pwsettings                           |   35 ++++---------------
 source4/torture/rpc/netlogon.c                     |    2 +-
 6 files changed, 28 insertions(+), 39 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 5834282..6da02b0 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -1578,8 +1578,8 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 			    struct ldb_dn *domain_dn,
 			    struct ldb_message *mod,
 			    const DATA_BLOB *new_password,
-			    struct samr_Password *lmNewHash, 
-			    struct samr_Password *ntNewHash,
+			    struct samr_Password *param_lmNewHash,
+			    struct samr_Password *param_ntNewHash,
 			    bool user_change,
 			    enum samr_RejectReason *reject_reason,
 			    struct samr_DomInfo1 **_dominfo)
@@ -1596,7 +1596,8 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 	int64_t minPwdAge;
 	uint_t minPwdLength, pwdProperties, pwdHistoryLength;
 	uint_t userAccountControl;
-	struct samr_Password *sambaLMPwdHistory, *sambaNTPwdHistory, *lmPwdHash, *ntPwdHash;
+	struct samr_Password *sambaLMPwdHistory, *sambaNTPwdHistory,
+		*lmPwdHash, *ntPwdHash, *lmNewHash, *ntNewHash;
 	struct samr_Password local_lmNewHash, local_ntNewHash;
 	int sambaLMPwdHistory_len, sambaNTPwdHistory_len;
 	struct dom_sid *domain_sid;
@@ -1624,6 +1625,10 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 	ntPwdHash =          samdb_result_hash(mem_ctx, res[0],   "unicodePwd");
 	pwdLastSet =         samdb_result_uint64(res[0], "pwdLastSet", 0);
 
+	/* Copy parameters */
+	lmNewHash = param_lmNewHash;
+	ntNewHash = param_ntNewHash;
+
 	/* Only non-trust accounts have restrictions (possibly this
 	 * test is the wrong way around, but I like to be restrictive
 	 * if possible */
@@ -1700,10 +1705,11 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 		ntNewHash = &local_ntNewHash;
 
 		/* Only check complexity if we can convert it at all.  Assuming unconvertable passwords are 'strong' */
-		if (convert_string_talloc_convenience(mem_ctx, lp_iconv_convenience(ldb_get_opaque(ctx, "loadparm")), 
-					  CH_UTF16, CH_UNIX, 
-					  new_password->data, new_password->length, 
-					  (void **)&new_pass, NULL, false)) {
+		if (convert_string_talloc_convenience(mem_ctx,
+			  lp_iconv_convenience(ldb_get_opaque(ctx, "loadparm")),
+			  CH_UTF16, CH_UNIX,
+			  new_password->data, new_password->length,
+			  (void **)&new_pass, NULL, false)) {
 
 			/* possibly check password complexity */
 			if (restrictions && (pwdProperties & DOMAIN_PASSWORD_COMPLEX) &&
diff --git a/source4/dsdb/samdb/ldb_modules/linked_attributes.c b/source4/dsdb/samdb/ldb_modules/linked_attributes.c
index fc101bd..b4144ef 100644
--- a/source4/dsdb/samdb/ldb_modules/linked_attributes.c
+++ b/source4/dsdb/samdb/ldb_modules/linked_attributes.c
@@ -593,7 +593,7 @@ static int linked_attributes_modify(struct ldb_module *module, struct ldb_reques
 	return ret;
 }
 
-/* delete, rename */
+/* delete */
 static int linked_attributes_del(struct ldb_module *module, struct ldb_request *req)
 {
 	struct ldb_context *ldb;
@@ -645,7 +645,7 @@ static int linked_attributes_del(struct ldb_module *module, struct ldb_request *
 	return ldb_next_request(module, search_req);
 }
 
-/* delete, rename */
+/* rename */
 static int linked_attributes_rename(struct ldb_module *module, struct ldb_request *req)
 {
 	struct la_context *ac;
diff --git a/source4/lib/ldb/include/ldb_errors.h b/source4/lib/ldb/include/ldb_errors.h
index 9362233..706d827 100644
--- a/source4/lib/ldb/include/ldb_errors.h
+++ b/source4/lib/ldb/include/ldb_errors.h
@@ -120,6 +120,7 @@
    backend.
 */
 #define LDB_ERR_STRONG_AUTH_REQUIRED		8
+
 /* 9 RESERVED */
 
 /**
@@ -181,6 +182,7 @@
    already exists in the entry.
 */
 #define LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS	20
+
 /**
    The function used an invalid (incorrect syntax) attribute value.
 */
diff --git a/source4/lib/ldb/modules/asq.c b/source4/lib/ldb/modules/asq.c
index 271cf52..0819f7f 100644
--- a/source4/lib/ldb/modules/asq.c
+++ b/source4/lib/ldb/modules/asq.c
@@ -26,8 +26,8 @@
  *
  *  Component: ldb attribute scoped query control module
  *
- *  Description: this module searches all the the objects pointed
- *  		 by the DNs contained in the references attribute
+ *  Description: this module searches all the objects pointed by
+ *  		 the DNs contained in the references attribute
  *
  *  Author: Simo Sorce
  */
diff --git a/source4/setup/pwsettings b/source4/setup/pwsettings
index fc59f8c..49bb551 100755
--- a/source4/setup/pwsettings
+++ b/source4/setup/pwsettings
@@ -82,9 +82,8 @@ except:
 		print "So no settings can be displayed!"
 		sys.exit(1)
 	else:
-		if pwd_props is None:
-			pwd_props = 0
-			print "WARNING: Assuming previous password properties 0 (used for password complexity setting)"
+		pwd_props = 0
+		print "WARNING: Assuming previous password properties 0 (used for password complexity setting)"
 
 if args[0] == "show":
 	print "Password informations for domain '" + domain_dn + "'"
@@ -105,11 +104,8 @@ elif args[0] == "set":
 
 			m = ldb.Message()
 			m.dn = ldb.Dn(samdb, domain_dn)
-			m["pwdProperties"] = ldb.MessageElement([],
-			  ldb.CHANGETYPE_DELETE, "pwdProperties")
-			samdb.modify(m)
 			m["pwdProperties"] = ldb.MessageElement(str(pwd_props),
-			  ldb.CHANGETYPE_ADD, "pwdProperties")
+			  ldb.FLAG_MOD_REPLACE, "pwdProperties")
 			samdb.modify(m)
 			print "Password complexity activated!"
 		elif opts.complexity == "off":
@@ -117,11 +113,8 @@ elif args[0] == "set":
 
 			m = ldb.Message()
 			m.dn = ldb.Dn(samdb, domain_dn)
-			m["pwdProperties"] = ldb.MessageElement([],
-			  ldb.CHANGETYPE_DELETE, "pwdProperties")
-			samdb.modify(m)
 			m["pwdProperties"] = ldb.MessageElement(str(pwd_props),
-			  ldb.CHANGETYPE_ADD, "pwdProperties")
+			  ldb.FLAG_MOD_REPLACE, "pwdProperties")
 			samdb.modify(m)
 			print "Password complexity deactivated!"
 		else:
@@ -136,11 +129,8 @@ elif args[0] == "set":
 
 		m = ldb.Message()
 		m.dn = ldb.Dn(samdb, domain_dn)
-		m["pwdHistoryLength"] = ldb.MessageElement([],
-		  ldb.CHANGETYPE_DELETE, "pwdHistoryLength")
-		samdb.modify(m)
 		m["pwdHistoryLength"] = ldb.MessageElement(str(pwd_hist_len),
-		  ldb.CHANGETYPE_ADD, "pwdHistoryLength")
+		  ldb.FLAG_MOD_REPLACE, "pwdHistoryLength")
 		samdb.modify(m)
 		print "Password history length changed!"
 
@@ -152,11 +142,8 @@ elif args[0] == "set":
 
 		m = ldb.Message()
 		m.dn = ldb.Dn(samdb, domain_dn)
-		m["minPwdLength"] = ldb.MessageElement([],
-		  ldb.CHANGETYPE_DELETE, "minPwdLength")
-		samdb.modify(m)
 		m["minPwdLength"] = ldb.MessageElement(str(min_pwd_len),
-		  ldb.CHANGETYPE_ADD, "minPwdLength")
+		  ldb.FLAG_MOD_REPLACE, "minPwdLength")
 		samdb.modify(m)
 		print "Minimum password length changed!"
 
@@ -170,11 +157,8 @@ elif args[0] == "set":
 
 		m = ldb.Message()
 		m.dn = ldb.Dn(samdb, domain_dn)
-		m["minPwdAge"] = ldb.MessageElement([],
-		  ldb.CHANGETYPE_DELETE, "minPwdAge")
-		samdb.modify(m)
 		m["minPwdAge"] = ldb.MessageElement(str(min_pwd_age),
-		  ldb.CHANGETYPE_ADD, "minPwdAge")
+		  ldb.FLAG_MOD_REPLACE, "minPwdAge")
 		samdb.modify(m)
 		print "Minimum password age changed!"
 
@@ -188,11 +172,8 @@ elif args[0] == "set":
 
 		m = ldb.Message()
 		m.dn = ldb.Dn(samdb, domain_dn)
-		m["maxPwdAge"] = ldb.MessageElement([],
-		  ldb.CHANGETYPE_DELETE, "maxPwdAge")
-		samdb.modify(m)
 		m["maxPwdAge"] = ldb.MessageElement(str(max_pwd_age),
-		  ldb.CHANGETYPE_ADD, "maxPwdAge")
+		  ldb.FLAG_MOD_REPLACE, "maxPwdAge")
 		samdb.modify(m)
 		print "Maximum password age changed!"
 
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index 40561dc..35f1a59 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -2211,7 +2211,7 @@ static bool test_GetDomainInfo(struct torture_context *tctx,
 	struct ldb_message_element *spn_el;
 	int ret, i;
 	char *version_str;
-	const char *old_dnsname;
+	const char *old_dnsname = NULL;
 	char **spns = NULL;
 	int num_spns = 0;
 	char *temp_str;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list