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

abartlet at samba.org abartlet at samba.org
Tue Aug 28 05:43:28 GMT 2007


Author: abartlet
Date: 2007-08-28 05:43:26 +0000 (Tue, 28 Aug 2007)
New Revision: 24731

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

Log:
Remove unused code - if we hit these error conditions, then we are
dead anyway, and a segfault would leave us with more infomation.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/extended_dn.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/kludge_acl.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/local_password.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectclass.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/partition.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/rootdse.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/schema.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/show_deleted.c


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/extended_dn.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/extended_dn.c	2007-08-28 04:35:29 UTC (rev 24730)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/extended_dn.c	2007-08-28 05:43:26 UTC (rev 24731)
@@ -181,11 +181,6 @@
 {
 	struct extended_context *ac;
 
-	if (!context || !ares) {
-		ldb_set_errstring(ldb, "NULL Context or Result in callback");
-		goto error;
-	}
-
 	ac = talloc_get_type(context, struct extended_context);
 
 	if (ares->type == LDB_REPLY_ENTRY) {

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	2007-08-28 04:35:29 UTC (rev 24730)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/kludge_acl.c	2007-08-28 05:43:26 UTC (rev 24731)
@@ -236,11 +236,6 @@
 	struct kludge_private_data *data;
 	int i, ret;
 
-	if (!context || !ares) {
-		ldb_set_errstring(ldb, "NULL Context or Result in callback");
-		goto error;
-	}
-
 	ac = talloc_get_type(context, struct kludge_acl_context);
 	data = talloc_get_type(ac->module->private_data, struct kludge_private_data);
 
@@ -296,10 +291,6 @@
 	}
 
 	return ac->up_callback(ldb, ac->up_context, ares);
-
-error:
-	talloc_free(ares);
-	return LDB_ERR_OPERATIONS_ERROR;
 }
 
 static int kludge_acl_search(struct ldb_module *module, struct ldb_request *req)

Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/local_password.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/local_password.c	2007-08-28 04:35:29 UTC (rev 24730)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/local_password.c	2007-08-28 05:43:26 UTC (rev 24731)
@@ -355,11 +355,6 @@
 {
 	struct lpdb_context *ac;
 
-	if (!context || !ares) {
-		ldb_set_errstring(ldb, "NULL Context or Result in callback");
-		return LDB_ERR_OPERATIONS_ERROR;
-	}
-
 	ac = talloc_get_type(context, struct lpdb_context);
 
 	/* we are interested only in the single reply (base search) we receive here */
@@ -461,11 +456,6 @@
 {
 	struct lpdb_local_search_context *local_context;
 
-	if (!context || !ares) {
-		ldb_set_errstring(ldb, "NULL Context or Result in callback");
-		return LDB_ERR_OPERATIONS_ERROR;
-	}
-
 	local_context = talloc_get_type(context, struct lpdb_local_search_context);
 
 	/* we are interested only in the single reply (base search) we receive here */
@@ -529,11 +519,6 @@
 {
 	struct lpdb_context *ac;
 
-	if (!context || !ares) {
-		ldb_set_errstring(ldb, "NULL Context or Result in callback");
-		goto error;
-	}
-
 	ac = talloc_get_type(context, struct lpdb_context);
 
 	if (ares->type == LDB_REPLY_ENTRY) {
@@ -610,9 +595,6 @@
 	} else {
 		return ac->orig_req->callback(ldb, ac->orig_req->context, ares);
 	}
-error:
-	talloc_free(ares);
-	return LDB_ERR_OPERATIONS_ERROR;
 }
 
 /* Search for passwords and other attributes.  The passwords are

Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectclass.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectclass.c	2007-08-28 04:35:29 UTC (rev 24730)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectclass.c	2007-08-28 05:43:26 UTC (rev 24731)
@@ -480,11 +480,6 @@
 {
 	struct oc_context *ac;
 
-	if (!context || !ares) {
-		ldb_set_errstring(ldb, "NULL Context or Result in callback");
-		return LDB_ERR_OPERATIONS_ERROR;
-	}
-
 	ac = talloc_get_type(context, struct oc_context);
 
 	/* we are interested only in the single reply (base search) we receive here */

Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/partition.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/partition.c	2007-08-28 04:35:29 UTC (rev 24730)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/partition.c	2007-08-28 05:43:26 UTC (rev 24731)
@@ -45,7 +45,6 @@
 
 struct partition_context {
 	struct ldb_module *module;
-	struct ldb_handle *handle;
 	struct ldb_request *orig_req;
 
 	struct ldb_request **down_req;
@@ -76,7 +75,6 @@
 	h->private_data	= ac;
 
 	ac->module = module;
-	ac->handle = h;
 	ac->orig_req = req;
 
 	req->handle = h;
@@ -126,11 +124,6 @@
 {
 	struct partition_context *ac;
 
-	if (!context || !ares) {
-		ldb_set_errstring(ldb, "partition_search_callback: NULL Context or Result in 'search' callback");
-		goto error;
-	}
-
 	ac = talloc_get_type(context, struct partition_context);
 
 	if (ares->type == LDB_REPLY_ENTRY) {
@@ -144,9 +137,6 @@
 			return LDB_SUCCESS;
 		}
 	}
-error:
-	talloc_free(ares);
-	return LDB_ERR_OPERATIONS_ERROR;
 }
 
 /*
@@ -156,11 +146,6 @@
 {
 	struct partition_context *ac;
 
-	if (!context) {
-		ldb_set_errstring(ldb, "partition_other_callback: NULL Context in 'other' callback");
-		goto error;
-	}
-
 	ac = talloc_get_type(context, struct partition_context);
 
 	if (!ac->orig_req->callback) {
@@ -179,7 +164,6 @@
 		return LDB_SUCCESS;
 	}
 	ldb_set_errstring(ldb, "partition_other_callback: Unknown reply type, only supports START_TLS");
-error:
 	talloc_free(ares);
 	return LDB_ERR_OPERATIONS_ERROR;
 }

Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c	2007-08-28 04:35:29 UTC (rev 24730)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c	2007-08-28 05:43:26 UTC (rev 24731)
@@ -1168,11 +1168,6 @@
 {
 	struct ph_context *ac;
 
-	if (!context || !ares) {
-		ldb_set_errstring(ldb, "NULL Context or Result in callback");
-		return LDB_ERR_OPERATIONS_ERROR;
-	}
-
 	ac = talloc_get_type(context, struct ph_context);
 
 	/* we are interested only in the single reply (base search) we receive here */
@@ -1629,11 +1624,6 @@
 {
 	struct ph_context *ac;
 
-	if (!context || !ares) {
-		ldb_set_errstring(ldb, "NULL Context or Result in callback");
-		return LDB_ERR_OPERATIONS_ERROR;
-	}
-
 	ac = talloc_get_type(context, struct ph_context);
 
 	/* we are interested only in the single reply (base search) we receive here */

Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/rootdse.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/rootdse.c	2007-08-28 04:35:29 UTC (rev 24730)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/rootdse.c	2007-08-28 05:43:26 UTC (rev 24731)
@@ -226,11 +226,6 @@
 {
 	struct rootdse_context *ac;
 
-	if (!context || !ares) {
-		ldb_set_errstring(ldb, "NULL Context or Result in callback");
-		goto error;
-	}
-
 	ac = talloc_get_type(context, struct rootdse_context);
 
 	if (ares->type == LDB_REPLY_ENTRY) {

Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/schema.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/schema.c	2007-08-28 04:35:29 UTC (rev 24730)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/schema.c	2007-08-28 05:43:26 UTC (rev 24731)
@@ -523,11 +523,6 @@
 {
 	struct schema_context *sctx;
 
-	if (!context || !ares) {
-		ldb_set_errstring(ldb, "NULL Context or Result in callback");
-		return LDB_ERR_OPERATIONS_ERROR;
-	}
-
 	sctx = talloc_get_type(context, struct schema_context);
 
 	/* we are interested only in the single reply (base search) we receive here */
@@ -883,7 +878,6 @@
 {
 	struct schema_class_dlist *temp;
 	struct ldb_message *msg;
-	char *oc;
 	int ret;
 
 	sctx->down_req = talloc(sctx, struct ldb_request);

Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/show_deleted.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/show_deleted.c	2007-08-28 04:35:29 UTC (rev 24730)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/show_deleted.c	2007-08-28 05:43:26 UTC (rev 24731)
@@ -52,11 +52,6 @@
 {
 	struct show_deleted_search_request *ar;
 
-	if (!context || !ares) {
-		ldb_set_errstring(ldb, "NULL Context or Result in callback");
-		goto error;
-	}
-
 	ar = talloc_get_type(context, struct show_deleted_search_request);
 
 	if (ares->type == LDB_REPLY_ENTRY) {
@@ -78,9 +73,6 @@
 skip_deleted:
 	talloc_free(ares);
 	return LDB_SUCCESS;
-error:
-	talloc_free(ares);
-	return LDB_ERR_OPERATIONS_ERROR;
 }
 
 static int show_deleted_search(struct ldb_module *module, struct ldb_request *req)



More information about the samba-cvs mailing list