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/resolve_oids.c | |
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/samdb/ldb_modules/resolve_oids.c')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/resolve_oids.c | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/resolve_oids.c b/source4/dsdb/samdb/ldb_modules/resolve_oids.c index 16cabc18cd..3c9ebcd745 100644 --- a/source4/dsdb/samdb/ldb_modules/resolve_oids.c +++ b/source4/dsdb/samdb/ldb_modules/resolve_oids.c @@ -53,8 +53,7 @@ static int resolve_oids_need_value(struct ldb_context *ldb, case DRSUAPI_ATTRIBUTE_possSuperiors: str = talloc_strndup(ldb, (char *)valp->data, valp->length); if (!str) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } vo = dsdb_class_by_governsID_oid(schema, str); talloc_free(str); @@ -68,8 +67,7 @@ static int resolve_oids_need_value(struct ldb_context *ldb, case DRSUAPI_ATTRIBUTE_mayContain: str = talloc_strndup(ldb, (char *)valp->data, valp->length); if (!str) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } va = dsdb_attribute_by_attributeID_oid(schema, str); talloc_free(str); @@ -246,8 +244,7 @@ static int resolve_oids_replace_value(struct ldb_context *ldb, case DRSUAPI_ATTRIBUTE_possSuperiors: str = talloc_strndup(schema, (char *)valp->data, valp->length); if (!str) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } vo = dsdb_class_by_governsID_oid(schema, str); talloc_free(str); @@ -262,8 +259,7 @@ static int resolve_oids_replace_value(struct ldb_context *ldb, case DRSUAPI_ATTRIBUTE_mayContain: str = talloc_strndup(schema, (char *)valp->data, valp->length); if (!str) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } va = dsdb_attribute_by_attributeID_oid(schema, str); talloc_free(str); @@ -509,22 +505,19 @@ static int resolve_oids_search(struct ldb_module *module, struct ldb_request *re ac = talloc(req, struct resolve_oids_context); if (ac == NULL) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } ac->module = module; ac->req = req; tree = ldb_parse_tree_copy_shallow(ac, req->op.search.tree); if (!tree) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } schema = talloc_reference(tree, schema); if (!schema) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } ret = resolve_oids_parse_tree_replace(ldb, schema, @@ -536,8 +529,7 @@ static int resolve_oids_search(struct ldb_module *module, struct ldb_request *re attrs2 = str_list_copy_const(ac, discard_const_p(const char *, req->op.search.attrs)); if (req->op.search.attrs && !attrs2) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } for (i=0; attrs2 && attrs2[i]; i++) { @@ -604,21 +596,18 @@ static int resolve_oids_add(struct ldb_module *module, struct ldb_request *req) ac = talloc(req, struct resolve_oids_context); if (ac == NULL) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } ac->module = module; ac->req = req; msg = ldb_msg_copy_shallow(ac, ac->req->op.add.message); if (!msg) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } if (!talloc_reference(msg, schema)) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } ret = resolve_oids_message_replace(ldb, schema, msg); @@ -670,8 +659,7 @@ static int resolve_oids_modify(struct ldb_module *module, struct ldb_request *re ac = talloc(req, struct resolve_oids_context); if (ac == NULL) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } ac->module = module; ac->req = req; @@ -679,13 +667,11 @@ static int resolve_oids_modify(struct ldb_module *module, struct ldb_request *re /* we have to copy the message as the caller might have it as a const */ msg = ldb_msg_copy_shallow(ac, req->op.mod.message); if (msg == NULL) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } if (!talloc_reference(msg, schema)) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } ret = resolve_oids_message_replace(ldb, schema, msg); |