From ca809186137e259060032ef61d9d3e93cddad298 Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Tue, 17 Aug 2010 03:58:26 +0300 Subject: s4-dsdb: Use dsdb_syntax_ctx in *_validate_ldb functions --- source4/dsdb/samdb/ldb_modules/objectclass_attrs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source4/dsdb/samdb/ldb_modules') diff --git a/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c b/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c index 070d8585ae..3c22eed7f8 100644 --- a/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c +++ b/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c @@ -79,6 +79,7 @@ static int attr_handler(struct oc_context *ac) unsigned int i; int ret; WERROR werr; + struct dsdb_syntax_ctx syntax_ctx; ldb = ldb_module_get_ctx(ac->module); @@ -91,6 +92,9 @@ static int attr_handler(struct oc_context *ac) return ldb_oom(ldb); } + /* initialize syntax checking context */ + dsdb_syntax_ctx_init(&syntax_ctx, ldb, ac->schema); + /* Check if attributes exist in the schema, if the values match, * if they're not operational and fix the names to the match the schema * case */ @@ -114,7 +118,7 @@ static int attr_handler(struct oc_context *ac) } if (!(msg->elements[i].flags & LDB_FLAG_INTERNAL_DISABLE_VALIDATION)) { - werr = attr->syntax->validate_ldb(ldb, ac->schema, attr, + werr = attr->syntax->validate_ldb(&syntax_ctx, attr, &msg->elements[i]); if (!W_ERROR_IS_OK(werr)) { ldb_asprintf_errstring(ldb, "objectclass_attrs: attribute '%s' on entry '%s' contains at least one invalid value!", -- cgit