svn commit: samba r13353 - in branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules: .

idra at samba.org idra at samba.org
Sun Feb 5 18:18:31 GMT 2006


Author: idra
Date: 2006-02-05 18:18:29 +0000 (Sun, 05 Feb 2006)
New Revision: 13353

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13353

Log:

Fix a crash bug in rootdse when we do not pass in credentials
a plain ldbsearch would just crash

Fix kludge_acl, not passing on the second stage registration
phase to other modules

Simo


Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/kludge_acl.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/rootdse.c


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/kludge_acl.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/kludge_acl.c	2006-02-05 17:28:27 UTC (rev 13352)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/kludge_acl.c	2006-02-05 18:18:29 UTC (rev 13353)
@@ -196,14 +196,11 @@
 			 NULL, attrs,
 			 &res);
 	if (ret != LDB_SUCCESS) {
-		talloc_free(mem_ctx);
-		return ret;
+		goto done;
 	}
 	talloc_steal(mem_ctx, res);
 	if (res->count == 0) {
-		talloc_free(mem_ctx);
-		data->password_attrs = NULL;
-		return LDB_SUCCESS;
+		goto done;
 	}
 
 	if (res->count > 1) {
@@ -215,8 +212,7 @@
 
 	password_attributes = ldb_msg_find_element(msg, "passwordAttribute");
 	if (!password_attributes) {
-		talloc_free(mem_ctx);
-		return LDB_SUCCESS;
+		goto done;
 	}
 	data->password_attrs = talloc_array(data, const char *, password_attributes->num_values + 1);
 	if (!data->password_attrs) {
@@ -228,8 +224,10 @@
 		talloc_steal(data->password_attrs, password_attributes->values[i].data);
 	}
 	data->password_attrs[i] = NULL;
+
+done:
 	talloc_free(mem_ctx);
-	return LDB_SUCCESS;
+	return ldb_next_second_stage_init(module);
 }
 
 static const struct ldb_module_ops kludge_acl_ops = {

Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/rootdse.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/rootdse.c	2006-02-05 17:28:27 UTC (rev 13352)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/rootdse.c	2006-02-05 18:18:29 UTC (rev 13353)
@@ -82,7 +82,7 @@
 
 	server_creds = talloc_get_type(ldb_get_opaque(module->ldb, "server_credentials"), 
 				       struct cli_credentials);
-	if (do_attribute(s->attrs, "supportedSASLMechanisms")) {
+	if (server_creds && do_attribute(s->attrs, "supportedSASLMechanisms")) {
 		struct gensec_security_ops **backends = gensec_security_all();
 		enum credentials_use_kerberos use_kerberos
 			= cli_credentials_get_kerberos_state(server_creds);



More information about the samba-cvs mailing list