diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-07-06 13:21:54 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-07-07 20:14:55 +1000 |
commit | 87df785a68c1c8043b345b71c98764ef36b76179 (patch) | |
tree | a4d3071a393661c93e97f9963e492d494241173c /source4/dsdb/schema | |
parent | fc68558ab937859a91214e8675d53c0afaf3c4e6 (diff) | |
download | samba-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')
-rw-r--r-- | source4/dsdb/schema/schema_init.c | 9 | ||||
-rw-r--r-- | source4/dsdb/schema/schema_set.c | 13 |
2 files changed, 10 insertions, 12 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c index bb22df18bb..7bcdf858dd 100644 --- a/source4/dsdb/schema/schema_init.c +++ b/source4/dsdb/schema/schema_init.c @@ -426,13 +426,12 @@ static int dsdb_schema_setup_ldb_schema_attribute(struct ldb_context *ldb, } if (s == NULL) { - return LDB_ERR_OPERATIONS_ERROR; + return ldb_operr(ldb); } attr->ldb_schema_attribute = a = talloc(attr, struct ldb_schema_attribute); if (attr->ldb_schema_attribute == NULL) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } a->name = attr->lDAPDisplayName; @@ -731,7 +730,7 @@ int dsdb_schema_from_ldb_results(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, schema = dsdb_new_schema(mem_ctx); if (!schema) { dsdb_oom(error_string, mem_ctx); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_operr(ldb); } schema->base_dn = talloc_steal(schema, schema_res->msgs[0]->dn); @@ -751,7 +750,7 @@ int dsdb_schema_from_ldb_results(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, "schema_fsmo_init: dsdb_schema_info_blob_new() failed - %s", win_errstr(status)); DEBUG(0,(__location__ ": %s\n", *error_string)); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_operr(ldb); } info_val = &info_val_default; } 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); |