summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2005-09-18 18:50:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:16 -0500
commit3d7935e656fe682e1d0545eaaa72428b78a65635 (patch)
tree29d354d775bd1df2ae729275a99abe7fdb8bb7d7
parent16aff2a184f7fab64d718b356056070e305e99e9 (diff)
downloadsamba-3d7935e656fe682e1d0545eaaa72428b78a65635.tar.gz
samba-3d7935e656fe682e1d0545eaaa72428b78a65635.tar.bz2
samba-3d7935e656fe682e1d0545eaaa72428b78a65635.zip
r10306: change these modules to use new error API
(This used to be commit e86c9b4a7f399a3152a2703c76406e9d69ec1225)
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectguid.c34
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c34
2 files changed, 4 insertions, 64 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/objectguid.c b/source4/dsdb/samdb/ldb_modules/objectguid.c
index c2569d18ca..2a27398fbc 100644
--- a/source4/dsdb/samdb/ldb_modules/objectguid.c
+++ b/source4/dsdb/samdb/ldb_modules/objectguid.c
@@ -38,10 +38,6 @@
#include "librpc/gen_ndr/ndr_misc.h"
#include <time.h>
-struct private_data {
- const char *error_string;
-};
-
static int objectguid_search(struct ldb_module *module, const struct ldb_dn *base,
enum ldb_scope scope, const char *expression,
const char * const *attrs, struct ldb_message ***res)
@@ -155,23 +151,6 @@ static int objectguid_end_trans(struct ldb_module *module, int status)
return ldb_next_end_trans(module, status);
}
-/* return extended error information */
-static const char *objectguid_errstring(struct ldb_module *module)
-{
- struct private_data *data = (struct private_data *)module->private_data;
-
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "objectguid_errstring\n");
- if (data->error_string) {
- const char *error;
-
- error = data->error_string;
- data->error_string = NULL;
- return error;
- }
-
- return ldb_next_errstring(module);
-}
-
static int objectguid_destructor(void *module_ctx)
{
/* struct ldb_module *ctx = module_ctx; */
@@ -188,8 +167,7 @@ static const struct ldb_module_ops objectguid_ops = {
.delete_record = objectguid_delete_record,
.rename_record = objectguid_rename_record,
.start_transaction = objectguid_start_trans,
- .end_transaction = objectguid_end_trans,
- .errstring = objectguid_errstring
+ .end_transaction = objectguid_end_trans
};
@@ -201,20 +179,12 @@ struct ldb_module *objectguid_module_init(struct ldb_context *ldb, const char *o
#endif
{
struct ldb_module *ctx;
- struct private_data *data;
ctx = talloc(ldb, struct ldb_module);
if (!ctx)
return NULL;
- data = talloc(ctx, struct private_data);
- if (!data) {
- talloc_free(ctx);
- return NULL;
- }
-
- data->error_string = NULL;
- ctx->private_data = data;
+ ctx->private_data = NULL;
ctx->ldb = ldb;
ctx->prev = ctx->next = NULL;
ctx->ops = &objectguid_ops;
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index 6ea98792b3..f7f7aca02e 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -40,10 +40,6 @@
#define SAM_ACCOUNT_NAME_BASE "$000000-000000000000"
-struct private_data {
- const char *error_string;
-};
-
static int samldb_search(struct ldb_module *module, const struct ldb_dn *base,
enum ldb_scope scope, const char *expression,
const char * const *attrs, struct ldb_message ***res)
@@ -599,23 +595,6 @@ static int samldb_end_trans(struct ldb_module *module, int status)
return ldb_next_end_trans(module, status);
}
-/* return extended error information */
-static const char *samldb_errstring(struct ldb_module *module)
-{
- struct private_data *data = (struct private_data *)module->private_data;
-
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "samldb_errstring\n");
- if (data->error_string) {
- const char *error;
-
- error = data->error_string;
- data->error_string = NULL;
- return error;
- }
-
- return ldb_next_errstring(module);
-}
-
static int samldb_destructor(void *module_ctx)
{
/* struct ldb_module *ctx = module_ctx; */
@@ -632,8 +611,7 @@ static const struct ldb_module_ops samldb_ops = {
.delete_record = samldb_delete_record,
.rename_record = samldb_rename_record,
.start_transaction = samldb_start_trans,
- .end_transaction = samldb_end_trans,
- .errstring = samldb_errstring
+ .end_transaction = samldb_end_trans
};
@@ -645,20 +623,12 @@ struct ldb_module *samldb_module_init(struct ldb_context *ldb, const char *optio
#endif
{
struct ldb_module *ctx;
- struct private_data *data;
ctx = talloc(ldb, struct ldb_module);
if (!ctx)
return NULL;
- data = talloc(ctx, struct private_data);
- if (!data) {
- talloc_free(ctx);
- return NULL;
- }
-
- data->error_string = NULL;
- ctx->private_data = data;
+ ctx->private_data = NULL;
ctx->ldb = ldb;
ctx->prev = ctx->next = NULL;
ctx->ops = &samldb_ops;