summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/ridalloc.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/ridalloc.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/ridalloc.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/ridalloc.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/ridalloc.c b/source4/dsdb/samdb/ldb_modules/ridalloc.c
index c14a679ec3..55636d13a7 100644
--- a/source4/dsdb/samdb/ldb_modules/ridalloc.c
+++ b/source4/dsdb/samdb/ldb_modules/ridalloc.c
@@ -178,9 +178,8 @@ static int ridalloc_create_rid_set_ntds(struct ldb_module *module, TALLOC_CTX *m
server_dn = ldb_dn_get_parent(tmp_ctx, ntds_dn);
if (!server_dn) {
- ldb_module_oom(module);
talloc_free(tmp_ctx);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_module_oom(module);
}
ret = dsdb_module_reference_dn(module, tmp_ctx, server_dn, "serverReference", &machine_dn);
@@ -193,15 +192,13 @@ static int ridalloc_create_rid_set_ntds(struct ldb_module *module, TALLOC_CTX *m
rid_set_dn = ldb_dn_copy(tmp_ctx, machine_dn);
if (rid_set_dn == NULL) {
- ldb_module_oom(module);
talloc_free(tmp_ctx);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_module_oom(module);
}
if (! ldb_dn_add_child_fmt(rid_set_dn, "CN=RID Set")) {
- ldb_module_oom(module);
talloc_free(tmp_ctx);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_module_oom(module);
}
/* grab a pool from the RID Manager object */
@@ -345,9 +342,8 @@ static int ridalloc_refresh_rid_set_ntds(struct ldb_module *module,
server_dn = ldb_dn_get_parent(tmp_ctx, ntds_dn);
if (!server_dn) {
- ldb_module_oom(module);
talloc_free(tmp_ctx);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_module_oom(module);
}
ret = dsdb_module_reference_dn(module, tmp_ctx, server_dn, "serverReference", &machine_dn);
@@ -587,9 +583,8 @@ int ridalloc_allocate_rid_pool_fsmo(struct ldb_module *module, struct dsdb_fsmo_
server_dn = ldb_dn_get_parent(tmp_ctx, ntds_dn);
if (!server_dn) {
- ldb_module_oom(module);
talloc_free(tmp_ctx);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_module_oom(module);
}
ret = dsdb_module_reference_dn(module, tmp_ctx, server_dn, "serverReference", &machine_dn);