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/samdb/ldb_modules/schema_data.c | |
parent | fc68558ab937859a91214e8675d53c0afaf3c4e6 (diff) | |
download | samba-87df785a68c1c8043b345b71c98764ef36b76179.tar.gz |
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/schema_data.c')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/schema_data.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/schema_data.c b/source4/dsdb/samdb/ldb_modules/schema_data.c index a6487441c1c..ec7e7b74b6d 100644 --- a/source4/dsdb/samdb/ldb_modules/schema_data.c +++ b/source4/dsdb/samdb/ldb_modules/schema_data.c @@ -115,8 +115,7 @@ static int schema_data_init(struct ldb_module *module) data = talloc(module, struct schema_data_private_data); if (data == NULL) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } data->schema_dn = schema_dn; @@ -186,8 +185,7 @@ static int schema_data_add(struct ldb_module *module, struct ldb_request *req) } if (!oid) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } status = dsdb_schema_pfm_find_oid(schema->prefixmap, oid, NULL); @@ -252,8 +250,7 @@ static int generate_dITContentRules(struct ldb_context *ldb, struct ldb_message if (sclass->auxiliaryClass || sclass->systemAuxiliaryClass) { char *ditcontentrule = schema_class_to_dITContentRule(msg, sclass, schema); if (!ditcontentrule) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } ret = ldb_msg_add_steal_string(msg, "dITContentRules", ditcontentrule); if (ret != LDB_SUCCESS) { @@ -274,8 +271,7 @@ static int generate_extendedAttributeInfo(struct ldb_context *ldb, for (attribute = schema->attributes; attribute; attribute = attribute->next) { char *val = schema_attribute_to_extendedInfo(msg, attribute); if (!val) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } ret = ldb_msg_add_string(msg, "extendedAttributeInfo", val); @@ -297,8 +293,7 @@ static int generate_extendedClassInfo(struct ldb_context *ldb, for (sclass = schema->classes; sclass; sclass = sclass->next) { char *val = schema_class_to_extendedInfo(msg, sclass); if (!val) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } ret = ldb_msg_add_string(msg, "extendedClassInfo", val); @@ -454,16 +449,14 @@ static int schema_data_search(struct ldb_module *module, struct ldb_request *req search_context = talloc(req, struct schema_data_search_data); if (!search_context) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } search_context->module = module; search_context->req = req; search_context->schema = talloc_reference(search_context, schema); if (!search_context->schema) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } ret = ldb_build_search_req_ex(&down_req, ldb, search_context, @@ -475,7 +468,7 @@ static int schema_data_search(struct ldb_module *module, struct ldb_request *req search_context, schema_data_search_callback, req); if (ret != LDB_SUCCESS) { - return LDB_ERR_OPERATIONS_ERROR; + return ldb_operr(ldb); } return ldb_next_request(module, down_req); |