summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/update_keytab.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-07-06 13:21:54 +1000
committerAndrew Tridgell <tridge@samba.org>2010-07-07 20:14:55 +1000
commit87df785a68c1c8043b345b71c98764ef36b76179 (patch)
treea4d3071a393661c93e97f9963e492d494241173c /source4/dsdb/samdb/ldb_modules/update_keytab.c
parentfc68558ab937859a91214e8675d53c0afaf3c4e6 (diff)
downloadsamba-87df785a68c1c8043b345b71c98764ef36b76179.tar.gz
samba-87df785a68c1c8043b345b71c98764ef36b76179.tar.bz2
samba-87df785a68c1c8043b345b71c98764ef36b76179.zip
s4-dsdb: use ldb_operr() in the dsdb code
this replaces "return LDB_ERR_OPERATIONS_ERROR" with "return ldb_operr(ldb)" in places in the dsdb code where we don't already explicitly set an error string. This should make is much easier to track down dsdb module bugs that result in an operations error.
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/update_keytab.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/update_keytab.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/update_keytab.c b/source4/dsdb/samdb/ldb_modules/update_keytab.c
index 620c047cd1..071974f5e4 100644
--- a/source4/dsdb/samdb/ldb_modules/update_keytab.c
+++ b/source4/dsdb/samdb/ldb_modules/update_keytab.c
@@ -90,8 +90,7 @@ static int add_modified(struct ldb_module *module, struct ldb_dn *dn, bool do_de
filter = talloc_asprintf(data, "(&(dn=%s)(&(objectClass=kerberosSecret)(privateKeytab=*)))",
ldb_dn_get_linearized(dn));
if (!filter) {
- ldb_oom(ldb);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_oom(ldb);
}
ret = ldb_search(ldb, data, &res,
@@ -112,16 +111,14 @@ static int add_modified(struct ldb_module *module, struct ldb_dn *dn, bool do_de
item = talloc(data->changed_dns? (void *)data->changed_dns: (void *)data, struct dn_list);
if (!item) {
talloc_free(filter);
- ldb_oom(ldb);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_oom(ldb);
}
item->creds = cli_credentials_init(item);
if (!item->creds) {
DEBUG(1, ("cli_credentials_init failed!"));
talloc_free(filter);
- ldb_oom(ldb);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_oom(ldb);
}
cli_credentials_set_conf(item->creds, ldb_get_opaque(ldb, "loadparm"));
@@ -287,7 +284,7 @@ static int update_kt_add(struct ldb_module *module, struct ldb_request *req)
ac = update_kt_ctx_init(module, req);
if (ac == NULL) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
ac->dn = req->op.add.message->dn;
@@ -316,7 +313,7 @@ static int update_kt_modify(struct ldb_module *module, struct ldb_request *req)
ac = update_kt_ctx_init(module, req);
if (ac == NULL) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
ac->dn = req->op.mod.message->dn;
@@ -340,7 +337,7 @@ static int update_kt_delete(struct ldb_module *module, struct ldb_request *req)
ac = update_kt_ctx_init(module, req);
if (ac == NULL) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb_module_get_ctx(module));
}
ac->dn = req->op.del.dn;
@@ -361,7 +358,7 @@ static int update_kt_rename(struct ldb_module *module, struct ldb_request *req)
ac = update_kt_ctx_init(module, req);
if (ac == NULL) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
ac->dn = req->op.rename.newdn;
@@ -425,8 +422,7 @@ static int update_kt_init(struct ldb_module *module)
data = talloc(module, struct update_kt_private);
if (data == NULL) {
- ldb_oom(ldb);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_oom(ldb);
}
data->changed_dns = NULL;