Author: idra Date: 2005-09-18 18:50:02 +0000 (Sun, 18 Sep 2005) New Revision: 10306
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10306 Log: change these modules to use new error API Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectguid.c branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c Changeset: Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectguid.c =================================================================== --- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectguid.c 2005-09-18 18:49:06 UTC (rev 10305) +++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/objectguid.c 2005-09-18 18:50:02 UTC (rev 10306) @@ -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 @@ 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 @@ .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 @@ #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; Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c =================================================================== --- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c 2005-09-18 18:49:06 UTC (rev 10305) +++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c 2005-09-18 18:50:02 UTC (rev 10306) @@ -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 @@ 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 @@ .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 @@ #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;