LDB:ldb_attributes.c - handle special attributes (@...) always in the default syntax
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 4 Sep 2012 20:25:04 +0000 (22:25 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 25 Sep 2013 08:31:25 +0000 (10:31 +0200)
This is a requirement for correct schema syntax comparison.

"lib/ldb/tests/test-tdb-features.sh" demostrates this when adding index
entries and the default syntax is set to INTEGER.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=8929

Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/ldb/common/ldb_attributes.c

index 21a3e6eb93b8f48a4fbd326a8357439f16c1a86d..924655dd77819496c4a5959d6cd91dde685a88d7 100644 (file)
@@ -127,6 +127,11 @@ static const struct ldb_schema_attribute *ldb_schema_attribute_by_name_internal(
        int r;
        const struct ldb_schema_attribute *def = &ldb_attribute_default;
 
+       /* special attributes should always be handled by the default syntax */
+       if (name[0] == '@') {
+               return def;
+       }
+
        /* as handlers are sorted, '*' must be the first if present */
        if (strcmp(ldb->schema.attributes[0].name, "*") == 0) {
                def = &ldb->schema.attributes[0];