diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-09-29 18:57:01 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-01-13 16:03:54 +0100 |
commit | a0f2a49b8a67a60c2ecc188043848140a3e944c2 (patch) | |
tree | e676ba5b35a12ce14eeb4e14add1ac54ef61fb8c /source4/dsdb/schema | |
parent | bf1f067b0c46f1c8378e6a517feeaad9b5c2b17c (diff) | |
download | samba-a0f2a49b8a67a60c2ecc188043848140a3e944c2.tar.gz samba-a0f2a49b8a67a60c2ecc188043848140a3e944c2.tar.bz2 samba-a0f2a49b8a67a60c2ecc188043848140a3e944c2.zip |
s4:dsdb/schema: add dsdb_syntax_BOOL_validate_ldb()
metze
Diffstat (limited to 'source4/dsdb/schema')
-rw-r--r-- | source4/dsdb/schema/schema_syntax.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c index 0da65884f6..1399d2fe15 100644 --- a/source4/dsdb/schema/schema_syntax.c +++ b/source4/dsdb/schema/schema_syntax.c @@ -182,6 +182,35 @@ static WERROR dsdb_syntax_BOOL_ldb_to_drsuapi(struct ldb_context *ldb, return WERR_OK; } +static WERROR dsdb_syntax_BOOL_validate_ldb(struct ldb_context *ldb, + const struct dsdb_schema *schema, + const struct dsdb_attribute *attr, + const struct ldb_message_element *in) +{ + uint32_t i; + + if (attr->attributeID_id == 0xFFFFFFFF) { + return WERR_FOOBAR; + } + + for (i=0; i < in->num_values; i++) { + int t, f; + + t = strncmp("TRUE", + (const char *)in->values[i].data, + in->values[i].length); + f = strncmp("FALSE", + (const char *)in->values[i].data, + in->values[i].length); + + if (t != 0 && f != 0) { + return WERR_DS_INVALID_ATTRIBUTE_SYNTAX; + } + } + + return WERR_OK; +} + static WERROR dsdb_syntax_INT32_drsuapi_to_ldb(struct ldb_context *ldb, const struct dsdb_schema *schema, const struct dsdb_attribute *attr, @@ -1625,7 +1654,7 @@ static const struct dsdb_syntax dsdb_syntaxes[] = { .attributeSyntax_oid = "2.5.5.8", .drsuapi_to_ldb = dsdb_syntax_BOOL_drsuapi_to_ldb, .ldb_to_drsuapi = dsdb_syntax_BOOL_ldb_to_drsuapi, - .validate_ldb = dsdb_syntax_ALLOW_validate_ldb, + .validate_ldb = dsdb_syntax_BOOL_validate_ldb, .equality = "booleanMatch", .comment = "Boolean" },{ |