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/samba_dsdb.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/samba_dsdb.c')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/samba_dsdb.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/samba_dsdb.c b/source4/dsdb/samdb/ldb_modules/samba_dsdb.c index b12d25a720..09990b06fb 100644 --- a/source4/dsdb/samdb/ldb_modules/samba_dsdb.c +++ b/source4/dsdb/samdb/ldb_modules/samba_dsdb.c @@ -49,15 +49,13 @@ static int read_at_rootdse_record(struct ldb_context *ldb, struct ldb_module *mo struct ldb_dn *rootdse_dn; TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx); if (!tmp_ctx) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } rootdse_dn = ldb_dn_new(tmp_ctx, ldb, "@ROOTDSE"); if (!rootdse_dn) { talloc_free(tmp_ctx); - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } ret = dsdb_module_search_dn(module, tmp_ctx, &rootdse_res, rootdse_dn, rootdse_attrs, 0); @@ -87,8 +85,7 @@ static int prepare_modules_line(struct ldb_context *ldb, char *full_string; TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx); if (!tmp_ctx) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } if (backend_attr) { @@ -112,22 +109,19 @@ static int prepare_modules_line(struct ldb_context *ldb, } if (!backend_full_list) { talloc_free(tmp_ctx); - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } backend_full_list = str_list_append_const(backend_full_list, backend_mod_list); if (!backend_full_list) { talloc_free(tmp_ctx); - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } mod_list_string = str_list_join(tmp_ctx, backend_full_list, ','); if (!mod_list_string) { talloc_free(tmp_ctx); - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } full_string = talloc_asprintf(tmp_ctx, "%s:%s", backend_dn, mod_list_string); @@ -222,15 +216,13 @@ static int samba_dsdb_init(struct ldb_module *module) const char *backendType, *serverRole; if (!tmp_ctx) { - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } samba_dsdb_dn = ldb_dn_new(tmp_ctx, ldb, "@SAMBA_DSDB"); if (!samba_dsdb_dn) { talloc_free(tmp_ctx); - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } #define CHECK_LDB_RET(check_ret) \ @@ -273,8 +265,7 @@ static int samba_dsdb_init(struct ldb_module *module) do { \ if (!final_module_list) { \ talloc_free(tmp_ctx); \ - ldb_oom(ldb); \ - return LDB_ERR_OPERATIONS_ERROR; \ + return ldb_oom(ldb); \ } \ } while (0) @@ -332,8 +323,7 @@ static int samba_dsdb_init(struct ldb_module *module) reverse_module_list = talloc_array(tmp_ctx, const char *, len+1); if (!reverse_module_list) { talloc_free(tmp_ctx); - ldb_oom(ldb); - return LDB_ERR_OPERATIONS_ERROR; + return ldb_oom(ldb); } for (i=0; i < len; i++) { reverse_module_list[i] = final_module_list[(len - 1) - i]; |