summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-08-28 05:43:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:03:00 -0500
commit714c5c92ef8e80b3510e222ce621401e55d05d7e (patch)
treec52e0dfb100f8cbbb83014a2f725d555954e6bbd
parent362ff066903524c710c53b92aad26671c8ebaa42 (diff)
downloadsamba-714c5c92ef8e80b3510e222ce621401e55d05d7e.tar.gz
samba-714c5c92ef8e80b3510e222ce621401e55d05d7e.tar.bz2
samba-714c5c92ef8e80b3510e222ce621401e55d05d7e.zip
r24731: 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 (This used to be commit 62320616ff8795ff18c8f49029d81f12558c10ed)
-rw-r--r--source4/dsdb/samdb/ldb_modules/extended_dn.c5
-rw-r--r--source4/dsdb/samdb/ldb_modules/kludge_acl.c9
-rw-r--r--source4/dsdb/samdb/ldb_modules/local_password.c18
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectclass.c5
-rw-r--r--source4/dsdb/samdb/ldb_modules/partition.c16
-rw-r--r--source4/dsdb/samdb/ldb_modules/password_hash.c10
-rw-r--r--source4/dsdb/samdb/ldb_modules/rootdse.c5
-rw-r--r--source4/dsdb/samdb/ldb_modules/schema.c6
-rw-r--r--source4/dsdb/samdb/ldb_modules/show_deleted.c8
9 files changed, 0 insertions, 82 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn.c b/source4/dsdb/samdb/ldb_modules/extended_dn.c
index 0a3227a912..6f32d22d26 100644
--- a/source4/dsdb/samdb/ldb_modules/extended_dn.c
+++ b/source4/dsdb/samdb/ldb_modules/extended_dn.c
@@ -181,11 +181,6 @@ static int extended_callback(struct ldb_context *ldb, void *context, struct ldb_
{
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) {
diff --git a/source4/dsdb/samdb/ldb_modules/kludge_acl.c b/source4/dsdb/samdb/ldb_modules/kludge_acl.c
index d26c8e3485..2d6d8a2d80 100644
--- a/source4/dsdb/samdb/ldb_modules/kludge_acl.c
+++ b/source4/dsdb/samdb/ldb_modules/kludge_acl.c
@@ -236,11 +236,6 @@ static int kludge_acl_callback(struct ldb_context *ldb, void *context, struct ld
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 @@ static int kludge_acl_callback(struct ldb_context *ldb, void *context, struct ld
}
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)
diff --git a/source4/dsdb/samdb/ldb_modules/local_password.c b/source4/dsdb/samdb/ldb_modules/local_password.c
index 97909c06b5..573d2e27b9 100644
--- a/source4/dsdb/samdb/ldb_modules/local_password.c
+++ b/source4/dsdb/samdb/ldb_modules/local_password.c
@@ -355,11 +355,6 @@ static int get_self_callback(struct ldb_context *ldb, void *context, struct ldb_
{
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 @@ static int lpdb_local_search_callback(struct ldb_context *ldb, void *context, st
{
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 @@ static int lpdb_remote_search_callback(struct ldb_context *ldb, void *context, s
{
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 @@ static int lpdb_remote_search_callback(struct ldb_context *ldb, void *context, s
} 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
diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c
index f7b2da9b83..04cf8efdb2 100644
--- a/source4/dsdb/samdb/ldb_modules/objectclass.c
+++ b/source4/dsdb/samdb/ldb_modules/objectclass.c
@@ -480,11 +480,6 @@ static int get_self_callback(struct ldb_context *ldb, void *context, struct ldb_
{
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 */
diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c
index ae739f9b00..0675f38c56 100644
--- a/source4/dsdb/samdb/ldb_modules/partition.c
+++ b/source4/dsdb/samdb/ldb_modules/partition.c
@@ -45,7 +45,6 @@ struct partition_private_data {
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 @@ static struct partition_context *partition_init_handle(struct ldb_request *req,
h->private_data = ac;
ac->module = module;
- ac->handle = h;
ac->orig_req = req;
req->handle = h;
@@ -126,11 +124,6 @@ static int partition_search_callback(struct ldb_context *ldb, void *context, str
{
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 @@ static int partition_search_callback(struct ldb_context *ldb, void *context, str
return LDB_SUCCESS;
}
}
-error:
- talloc_free(ares);
- return LDB_ERR_OPERATIONS_ERROR;
}
/*
@@ -156,11 +146,6 @@ static int partition_other_callback(struct ldb_context *ldb, void *context, stru
{
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 @@ static int partition_other_callback(struct ldb_context *ldb, void *context, stru
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;
}
diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c
index 718e0480af..61e9002439 100644
--- a/source4/dsdb/samdb/ldb_modules/password_hash.c
+++ b/source4/dsdb/samdb/ldb_modules/password_hash.c
@@ -1168,11 +1168,6 @@ static int get_domain_data_callback(struct ldb_context *ldb, void *context, stru
{
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 @@ static int get_self_callback(struct ldb_context *ldb, void *context, struct ldb_
{
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 */
diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c
index 0afc2dfb8e..a808d674e2 100644
--- a/source4/dsdb/samdb/ldb_modules/rootdse.c
+++ b/source4/dsdb/samdb/ldb_modules/rootdse.c
@@ -226,11 +226,6 @@ static int rootdse_callback(struct ldb_context *ldb, void *context, struct ldb_r
{
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) {
diff --git a/source4/dsdb/samdb/ldb_modules/schema.c b/source4/dsdb/samdb/ldb_modules/schema.c
index 2de5e892ed..21e93e1715 100644
--- a/source4/dsdb/samdb/ldb_modules/schema.c
+++ b/source4/dsdb/samdb/ldb_modules/schema.c
@@ -523,11 +523,6 @@ static int schema_add_check_parent(struct ldb_context *ldb, void *context, struc
{
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 @@ static int schema_add_build_down_req(struct schema_context *sctx)
{
struct schema_class_dlist *temp;
struct ldb_message *msg;
- char *oc;
int ret;
sctx->down_req = talloc(sctx, struct ldb_request);
diff --git a/source4/dsdb/samdb/ldb_modules/show_deleted.c b/source4/dsdb/samdb/ldb_modules/show_deleted.c
index cbc9d50b06..19fa63fb6e 100644
--- a/source4/dsdb/samdb/ldb_modules/show_deleted.c
+++ b/source4/dsdb/samdb/ldb_modules/show_deleted.c
@@ -52,11 +52,6 @@ static int show_deleted_search_callback(struct ldb_context *ldb, void *context,
{
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 @@ static int show_deleted_search_callback(struct ldb_context *ldb, void *context,
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)