summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-08-09 14:41:20 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-08-09 11:56:23 +0200
commit4ede333f468b36fb7435c9de1216da3b66bf0490 (patch)
tree2fb641d6df7f893ca29432fc89fe732d673a1450 /source4/dsdb/schema
parent2ba18d89eb066cf52d8bbd18a28e494bb4247d9c (diff)
downloadsamba-4ede333f468b36fb7435c9de1216da3b66bf0490.tar.gz
samba-4ede333f468b36fb7435c9de1216da3b66bf0490.tar.bz2
samba-4ede333f468b36fb7435c9de1216da3b66bf0490.zip
s4-dsdb: add auto-normalisation of attributes
this auto-normalises some attributes when they are added/modified. The list that we auto-normalise is currently: Boolean INT32 INTEGER UTC_TIME This fixes a problem with groupType being stored in an unnormalised form Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/schema')
-rw-r--r--source4/dsdb/schema/schema.h1
-rw-r--r--source4/dsdb/schema/schema_syntax.c12
2 files changed, 10 insertions, 3 deletions
diff --git a/source4/dsdb/schema/schema.h b/source4/dsdb/schema/schema.h
index 13cc31ca87..58cf82b297 100644
--- a/source4/dsdb/schema/schema.h
+++ b/source4/dsdb/schema/schema.h
@@ -73,6 +73,7 @@ struct dsdb_syntax {
WERROR (*validate_ldb)(const struct dsdb_syntax_ctx *ctx,
const struct dsdb_attribute *attr,
const struct ldb_message_element *in);
+ bool auto_normalise;
};
struct dsdb_attribute {
diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c
index d443c009af..501ab3aded 100644
--- a/source4/dsdb/schema/schema_syntax.c
+++ b/source4/dsdb/schema/schema_syntax.c
@@ -2365,7 +2365,8 @@ static const struct dsdb_syntax dsdb_syntaxes[] = {
.ldb_to_drsuapi = dsdb_syntax_BOOL_ldb_to_drsuapi,
.validate_ldb = dsdb_syntax_BOOL_validate_ldb,
.equality = "booleanMatch",
- .comment = "Boolean"
+ .comment = "Boolean",
+ .auto_normalise = true
},{
.name = "Integer",
.ldap_oid = LDB_SYNTAX_INTEGER,
@@ -2376,7 +2377,8 @@ static const struct dsdb_syntax dsdb_syntaxes[] = {
.validate_ldb = dsdb_syntax_INT32_validate_ldb,
.equality = "integerMatch",
.comment = "Integer",
- .ldb_syntax = LDB_SYNTAX_SAMBA_INT32
+ .ldb_syntax = LDB_SYNTAX_SAMBA_INT32,
+ .auto_normalise = true
},{
.name = "String(Octet)",
.ldap_oid = LDB_SYNTAX_OCTET_STRING,
@@ -2417,7 +2419,8 @@ static const struct dsdb_syntax dsdb_syntaxes[] = {
.drsuapi_to_ldb = dsdb_syntax_INT32_drsuapi_to_ldb,
.ldb_to_drsuapi = dsdb_syntax_INT32_ldb_to_drsuapi,
.validate_ldb = dsdb_syntax_INT32_validate_ldb,
- .ldb_syntax = LDB_SYNTAX_SAMBA_INT32
+ .ldb_syntax = LDB_SYNTAX_SAMBA_INT32,
+ .auto_normalise = true
},{
/* not used in w2k3 forest */
.name = "String(Numeric)",
@@ -2473,6 +2476,7 @@ static const struct dsdb_syntax dsdb_syntaxes[] = {
.validate_ldb = dsdb_syntax_NTTIME_UTC_validate_ldb,
.equality = "generalizedTimeMatch",
.comment = "UTC Time",
+ .auto_normalise = true
},{
.name = "String(Generalized-Time)",
.ldap_oid = "1.3.6.1.4.1.1466.115.121.1.24",
@@ -2484,6 +2488,7 @@ static const struct dsdb_syntax dsdb_syntaxes[] = {
.equality = "generalizedTimeMatch",
.comment = "Generalized Time",
.ldb_syntax = LDB_SYNTAX_UTC_TIME,
+ .auto_normalise = true
},{
/* not used in w2k3 schema */
.name = "String(Case Sensitive)",
@@ -2522,6 +2527,7 @@ static const struct dsdb_syntax dsdb_syntaxes[] = {
.equality = "integerMatch",
.comment = "Large Integer",
.ldb_syntax = LDB_SYNTAX_INTEGER,
+ .auto_normalise = true
},{
.name = "String(NT-Sec-Desc)",
.ldap_oid = LDB_SYNTAX_SAMBA_SECURITY_DESCRIPTOR,