From 47591ea5ec03916393d22484e3b551da033260ea Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 21 Oct 2010 12:47:57 +1100 Subject: s4-dsdb: moved a bunch of fuctions from schema/schema_info_attr.c to samdb/ldb_modules/schema_util.c these functions operate on ldb_modules, so they should be in the ldb_modules directory. They also should return ldb errors codes, not WERROR codes, as otherwise the error can be hidden from the ldap caller This re-arrangement fixes a dependency loop in the schema/samdb code. Pair-Programmed-With: Andrew Bartlett Pair-Programmed-With: Kamen Mazdrashki --- source4/dsdb/samdb/ldb_modules/samldb.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'source4/dsdb/samdb/ldb_modules/samldb.c') diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c index 8db93b2a8a..21b6506fb9 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -706,7 +706,7 @@ static int samldb_fill_foreignSecurityPrincipal_object(struct samldb_ctx *ac) static int samldb_schema_info_update(struct samldb_ctx *ac) { - WERROR werr; + int ret; struct ldb_context *ldb; struct dsdb_schema *schema; @@ -729,14 +729,11 @@ static int samldb_schema_info_update(struct samldb_ctx *ac) return ldb_operr(ldb); } - werr = dsdb_module_schema_info_update(ac->module, schema, DSDB_FLAG_NEXT_MODULE); - if (!W_ERROR_IS_OK(werr)) { - ldb_debug_set(ldb, LDB_DEBUG_FATAL, - "samldb_schema_info_update: " - "dsdb_module_schema_info_update failed with %s", - win_errstr(werr)); - DEBUG(0,(__location__ ": %s\n", ldb_errstring(ldb))); - return ldb_operr(ldb); + ret = dsdb_module_schema_info_update(ac->module, schema, DSDB_FLAG_NEXT_MODULE); + if (ret != LDB_SUCCESS) { + ldb_asprintf_errstring(ldb, "samldb_schema_info_update: dsdb_module_schema_info_update failed with %s", + ldb_errstring(ldb)); + return ret; } return LDB_SUCCESS; -- cgit