diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-12-15 18:56:56 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:29:19 -0500 |
commit | 8e7d87babc40688023085668ad88e219870c1280 (patch) | |
tree | 9d89e44bd47819ec265484345213e3f9037c7fed /source4/lib/ldb | |
parent | bc58f6fa3697fdddeed95bdeeec1a3f836bac162 (diff) | |
download | samba-8e7d87babc40688023085668ad88e219870c1280.tar.gz samba-8e7d87babc40688023085668ad88e219870c1280.tar.bz2 samba-8e7d87babc40688023085668ad88e219870c1280.zip |
r20188: move back to an default attribute handler and not use the '*' attribute
to not conflict with the one that maybe added via the @ATTRIBUTES object
this is just to make the test-tdb-feature.sh torture test happy
There's still a bug when a attribute is registered multiple time
without removing old ldb_schema_attribute instances. But this bug
was there before my changes too and was just triggered by my changes
metze
(This used to be commit 70c4a367433f8c54bdd940eb0a6a24ab976a4063)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r-- | source4/lib/ldb/common/ldb_attributes.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/source4/lib/ldb/common/ldb_attributes.c b/source4/lib/ldb/common/ldb_attributes.c index f884c1d5c6..0cd92576dc 100644 --- a/source4/lib/ldb/common/ldb_attributes.c +++ b/source4/lib/ldb/common/ldb_attributes.c @@ -86,6 +86,20 @@ int ldb_schema_attribute_add_with_syntax(struct ldb_context *ldb, return 0; } +static const struct ldb_schema_syntax ldb_syntax_default = { + .name = LDB_SYNTAX_OCTET_STRING, + .ldif_read_fn = ldb_handler_copy, + .ldif_write_fn = ldb_handler_copy, + .canonicalise_fn = ldb_handler_copy, + .comparison_fn = ldb_comparison_binary +}; + +static const struct ldb_schema_attribute ldb_attribute_default = { + .name = NULL, + .flags = 0, + .syntax = &ldb_syntax_default +}; + /* return the attribute handlers for a given attribute */ @@ -93,7 +107,7 @@ const struct ldb_schema_attribute *ldb_schema_attribute_by_name(struct ldb_conte const char *name) { int i, e, b = 0, r; - const struct ldb_schema_attribute *def = NULL; + const struct ldb_schema_attribute *def = &ldb_attribute_default; /* as handlers are sorted, '*' must be the first if present */ if (strcmp(ldb->schema.attributes[0].name, "*") == 0) { @@ -171,7 +185,6 @@ int ldb_setup_wellknown_attributes(struct ldb_context *ldb) const char *attr; const char *syntax; } wellknown[] = { - { "*", LDB_SYNTAX_OCTET_STRING }, { "dn", LDB_SYNTAX_DN }, { "distinguishedName", LDB_SYNTAX_DN }, { "cn", LDB_SYNTAX_DIRECTORY_STRING }, |