summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema/schema_set.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/schema/schema_set.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/schema/schema_set.c')
-rw-r--r--source4/dsdb/schema/schema_set.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c
index 1dcb4f89d5..5d63670621 100644
--- a/source4/dsdb/schema/schema_set.c
+++ b/source4/dsdb/schema/schema_set.c
@@ -65,7 +65,7 @@ static int dsdb_schema_set_attributes(struct ldb_context *ldb, struct dsdb_schem
mem_ctx = talloc_new(ldb);
if (!mem_ctx) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_oom(ldb);
}
msg = ldb_msg_new(mem_ctx);
@@ -182,7 +182,7 @@ static int dsdb_schema_set_attributes(struct ldb_context *ldb, struct dsdb_schem
op_error:
talloc_free(mem_ctx);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
static int uint32_cmp(uint32_t c1, uint32_t c2)
@@ -339,8 +339,7 @@ static int dsdb_setup_sorted_accessors(struct ldb_context *ldb,
failed:
dsdb_sorted_accessors_free(schema);
- ldb_oom(ldb);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_oom(ldb);
}
int dsdb_setup_schema_inversion(struct ldb_context *ldb, struct dsdb_schema *schema)
@@ -433,7 +432,7 @@ int dsdb_reference_schema(struct ldb_context *ldb, struct dsdb_schema *schema,
talloc_unlink(ldb, old_schema);
if (talloc_reference(ldb, schema) == NULL) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_oom(ldb);
}
ret = dsdb_schema_set_attributes(ldb, schema, write_attributes);
@@ -464,7 +463,7 @@ int dsdb_set_global_schema(struct ldb_context *ldb)
if (ret == LDB_SUCCESS) {
/* Keep a reference to this schema, just incase the original copy is replaced */
if (talloc_reference(ldb, global_schema) == NULL) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_oom(ldb);
}
}
@@ -580,7 +579,7 @@ int dsdb_schema_fill_extended_dn(struct ldb_context *ldb, struct dsdb_schema *sc
status = GUID_to_ndr_blob(&target_class->objectGUID, dn, &guid);
if (!NT_STATUS_IS_OK(status)) {
talloc_free(dn);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
ldb_dn_set_extended_component(dn, "GUID", &guid);