[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Fri Dec 7 09:52:02 MST 2012


The branch, master has been updated
       via  16d725b Fix bug #9471 - SEGV when using second vfs module.
       via  734d14b s4:dsdb/descriptor: fix replication of NC heads
       via  8021247 s4:dsdb/acl_read: improve debugging for fatal error
       via  14b5b72 s4:dsdb/acl_read: keep the ldb_message of the sub search (bug #9470)
       via  3535f8e s4:dsdb/schema_data.c: correctly move the CN=Aggregate attributes to msg->elements[i].values (bug #9470)
       via  944b686 s4:dsdb/schema: fix dsdb_schema_set_el_from_ldb_msg() (bug #9470)
      from  0fa3129 s3: Fix clear_if_first for the async echo handler

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


- Log -----------------------------------------------------------------
commit 16d725b4f5ed77db865e2a3c27ae0eb4accca5a8
Author: Tsukasa Hamano <hamano at osstech.co.jp>
Date:   Thu Dec 6 13:01:33 2012 -0800

    Fix bug #9471 - SEGV when using second vfs module.
    
    Don't use default_classname_table when we obviously shoud be using
    classname_table.
    
    Reviewed by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Fri Dec  7 17:51:50 CET 2012 on sn-devel-104

commit 734d14b54834a4d03e67bcaece4f4e3cf1d10925
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 7 12:56:21 2012 +0000

    s4:dsdb/descriptor: fix replication of NC heads
    
    The sub NC heads maybe replicated with the parent partition,
    if we don't need to recalculate the nTSecurityDescriptor attribute in that
    case, the replication of the of the sub partition should handle that.
    
    This fixes error messages like this:
    descriptor_sd_propagation_recursive: DC=ForestDnsZones,DC=s40dom,DC=base not found under DC=s40dom,DC=base
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 802124789513ef207a154ee950dc03e66a80e0b1
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 7 13:39:31 2012 +0100

    s4:dsdb/acl_read: improve debugging for fatal error
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 14b5b729049d92c30ba518adb82c9396fdddd09f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 7 11:02:49 2012 +0100

    s4:dsdb/acl_read: keep the ldb_message of the sub search (bug #9470)
    
    Some modules might not allocate values on the correct memory context.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 3535f8effefef6a68d2b686abe2769d797531dd9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 7 10:08:14 2012 +0000

    s4:dsdb/schema_data.c: correctly move the CN=Aggregate attributes to msg->elements[i].values (bug #9470)
    
    We should keep the talloc hierarchy sane.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 944b6863a71efc48ccc8cd9ae8ad1a3081bc1805
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Dec 7 10:34:58 2012 +0100

    s4:dsdb/schema: fix dsdb_schema_set_el_from_ldb_msg() (bug #9470)
    
    We should always update the ts_last_change.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

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

Summary of changes:
 lib/util/debug.c                             |    2 +-
 source4/dsdb/samdb/ldb_modules/acl_read.c    |   26 +++++++++++++++++++++++---
 source4/dsdb/samdb/ldb_modules/descriptor.c  |    4 ++--
 source4/dsdb/samdb/ldb_modules/schema_data.c |   24 ++++++++++++++++++------
 source4/dsdb/schema/schema_set.c             |   14 +++++++-------
 5 files changed, 51 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/debug.c b/lib/util/debug.c
index 15a2452..7509f90 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -1007,7 +1007,7 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func)
 			slprintf(header_str + hs_len,
 				 sizeof(header_str) -1 - hs_len,
 				 ", class=%s",
-				 default_classname_table[cls]);
+				 classname_table[cls]);
 		}
 
 		/* Print it all out at once to prevent split syslog output. */
diff --git a/source4/dsdb/samdb/ldb_modules/acl_read.c b/source4/dsdb/samdb/ldb_modules/acl_read.c
index 92744f2..2b20f24 100644
--- a/source4/dsdb/samdb/ldb_modules/acl_read.c
+++ b/source4/dsdb/samdb/ldb_modules/acl_read.c
@@ -91,7 +91,9 @@ static int aclread_callback(struct ldb_request *req, struct ldb_reply *ares)
 		msg = ares->message;
 		ret = dsdb_get_sd_from_ldb_message(ldb, tmp_ctx, msg, &sd);
 		if (ret != LDB_SUCCESS || sd == NULL ) {
-			DEBUG(10, ("acl_read: cannot get descriptor\n"));
+			ldb_debug_set(ldb, LDB_DEBUG_FATAL,
+				      "acl_read: cannot get descriptor of %s\n",
+				      ldb_dn_get_linearized(msg->dn));
 			ret = LDB_ERR_OPERATIONS_ERROR;
 			goto fail;
 		}
@@ -113,6 +115,11 @@ static int aclread_callback(struct ldb_request *req, struct ldb_reply *ares)
 				talloc_free(tmp_ctx);
 				return LDB_SUCCESS;
 			} else if (ret != LDB_SUCCESS) {
+				ldb_debug_set(ldb, LDB_DEBUG_FATAL,
+					      "acl_read: %s check parent %s - %s\n",
+					      ldb_dn_get_linearized(msg->dn),
+					      ldb_strerror(ret),
+					      ldb_errstring(ldb));
 				goto fail;
 			}
 		}
@@ -124,8 +131,10 @@ static int aclread_callback(struct ldb_request *req, struct ldb_reply *ares)
 			attr = dsdb_attribute_by_lDAPDisplayName(ac->schema,
 								 msg->elements[i].name);
 			if (!attr) {
-				DEBUG(2, ("acl_read: cannot find attribute %s in schema\n",
-					   msg->elements[i].name));
+				ldb_debug_set(ldb, LDB_DEBUG_FATAL,
+					      "acl_read: %s cannot find attr[%s] in of schema\n",
+					      ldb_dn_get_linearized(msg->dn),
+					      msg->elements[i].name);
 				ret = LDB_ERR_OPERATIONS_ERROR;
 				goto fail;
 			}
@@ -216,6 +225,12 @@ static int aclread_callback(struct ldb_request *req, struct ldb_reply *ares)
 					}
 				}
 			} else if (ret != LDB_SUCCESS) {
+				ldb_debug_set(ldb, LDB_DEBUG_FATAL,
+					      "acl_read: %s check attr[%s] gives %s - %s\n",
+					      ldb_dn_get_linearized(msg->dn),
+					      msg->elements[i].name,
+					      ldb_strerror(ret),
+					      ldb_errstring(ldb));
 				goto fail;
 			}
 		}
@@ -245,6 +260,11 @@ static int aclread_callback(struct ldb_request *req, struct ldb_reply *ares)
 					k++;
 				}
 			}
+			/*
+			 * This should not be needed, but some modules
+			 * may allocate values on the wrong context...
+			 */
+			talloc_steal(ret_msg->elements, msg);
 		} else {
 			ret_msg->elements = NULL;
 		}
diff --git a/source4/dsdb/samdb/ldb_modules/descriptor.c b/source4/dsdb/samdb/ldb_modules/descriptor.c
index 95204b3..192c745 100644
--- a/source4/dsdb/samdb/ldb_modules/descriptor.c
+++ b/source4/dsdb/samdb/ldb_modules/descriptor.c
@@ -1192,12 +1192,12 @@ static int descriptor_sd_propagation_recursive(struct ldb_module *module,
 				      msg);
 
 		if (msg == NULL) {
-			ldb_debug_set(ldb, LDB_DEBUG_FATAL,
+			ldb_debug(ldb, LDB_DEBUG_WARNING,
 				"descriptor_sd_propagation_recursive: "
 				"%s not found under %s",
 				ldb_dn_get_linearized(c->dn),
 				ldb_dn_get_linearized(change->dn));
-			return LDB_ERR_OPERATIONS_ERROR;
+			continue;
 		}
 
 		msg->elements = (struct ldb_message_element *)c;
diff --git a/source4/dsdb/samdb/ldb_modules/schema_data.c b/source4/dsdb/samdb/ldb_modules/schema_data.c
index bc9488b..3ce7ef9 100644
--- a/source4/dsdb/samdb/ldb_modules/schema_data.c
+++ b/source4/dsdb/samdb/ldb_modules/schema_data.c
@@ -405,7 +405,11 @@ static int generate_objectClasses(struct ldb_context *ldb, struct ldb_message *m
 	int ret;
 
 	for (sclass = schema->classes; sclass; sclass = sclass->next) {
-		ret = ldb_msg_add_string(msg, "objectClasses", schema_class_to_description(msg, sclass));
+		char *v = schema_class_to_description(msg, sclass);
+		if (v == NULL) {
+			return ldb_oom(ldb);
+		}
+		ret = ldb_msg_add_steal_string(msg, "objectClasses", v);
 		if (ret != LDB_SUCCESS) {
 			return ret;
 		}
@@ -417,9 +421,13 @@ static int generate_attributeTypes(struct ldb_context *ldb, struct ldb_message *
 {
 	const struct dsdb_attribute *attribute;
 	int ret;
-	
+
 	for (attribute = schema->attributes; attribute; attribute = attribute->next) {
-		ret = ldb_msg_add_string(msg, "attributeTypes", schema_attribute_to_description(msg, attribute));
+		char *v = schema_attribute_to_description(msg, attribute);
+		if (v == NULL) {
+			return ldb_oom(ldb);
+		}
+		ret = ldb_msg_add_steal_string(msg, "attributeTypes", v);
 		if (ret != LDB_SUCCESS) {
 			return ret;
 		}
@@ -461,7 +469,7 @@ static int generate_extendedAttributeInfo(struct ldb_context *ldb,
 			return ldb_oom(ldb);
 		}
 
-		ret = ldb_msg_add_string(msg, "extendedAttributeInfo", val);
+		ret = ldb_msg_add_steal_string(msg, "extendedAttributeInfo", val);
 		if (ret != LDB_SUCCESS) {
 			return ret;
 		}
@@ -483,7 +491,7 @@ static int generate_extendedClassInfo(struct ldb_context *ldb,
 			return ldb_oom(ldb);
 		}
 
-		ret = ldb_msg_add_string(msg, "extendedClassInfo", val);
+		ret = ldb_msg_add_steal_string(msg, "extendedClassInfo", val);
 		if (ret != LDB_SUCCESS) {
 			return ret;
 		}
@@ -521,7 +529,11 @@ static int generate_possibleInferiors(struct ldb_context *ldb, struct ldb_messag
 	}
 
 	for (i=0;possibleInferiors[i];i++) {
-		ret = ldb_msg_add_string(msg, "possibleInferiors", possibleInferiors[i]);
+		char *v = talloc_strdup(msg, possibleInferiors[i]);
+		if (v == NULL) {
+			return ldb_oom(ldb);
+		}
+		ret = ldb_msg_add_steal_string(msg, "possibleInferiors", v);
 		if (ret != LDB_SUCCESS) {
 			return ret;
 		}
diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c
index e226118..31862a4 100644
--- a/source4/dsdb/schema/schema_set.c
+++ b/source4/dsdb/schema/schema_set.c
@@ -676,13 +676,6 @@ WERROR dsdb_schema_set_el_from_ldb_msg(struct ldb_context *ldb, struct dsdb_sche
 {
 	const char* tstring;
 	time_t ts;
-	if (samdb_find_attribute(ldb, msg,
-				 "objectclass", "attributeSchema") != NULL) {
-		return dsdb_set_attribute_from_ldb(ldb, schema, msg);
-	} else if (samdb_find_attribute(ldb, msg,
-				 "objectclass", "classSchema") != NULL) {
-		return dsdb_set_class_from_ldb(schema, msg);
-	}
 	tstring = ldb_msg_find_attr_as_string(msg, "whenChanged", NULL);
 	/* keep a trace of the ts of the most recently changed object */
 	if (tstring) {
@@ -691,6 +684,13 @@ WERROR dsdb_schema_set_el_from_ldb_msg(struct ldb_context *ldb, struct dsdb_sche
 			schema->ts_last_change = ts;
 		}
 	}
+	if (samdb_find_attribute(ldb, msg,
+				 "objectclass", "attributeSchema") != NULL) {
+		return dsdb_set_attribute_from_ldb(ldb, schema, msg);
+	} else if (samdb_find_attribute(ldb, msg,
+				 "objectclass", "classSchema") != NULL) {
+		return dsdb_set_class_from_ldb(schema, msg);
+	}
 	/* Don't fail on things not classes or attributes */
 	return WERR_OK;
 }


-- 
Samba Shared Repository


More information about the samba-cvs mailing list