summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common/ldb_attributes.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-12-14 10:03:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:29:17 -0500
commite55ff42229d67c1447f2c811191b79137b1ce8cc (patch)
tree61448fcdfc6030de5aaa1098df88ab48bc0dc1c3 /source4/lib/ldb/common/ldb_attributes.c
parent66afa1003726fe8b4eeb98000581222a5f1f39c5 (diff)
downloadsamba-e55ff42229d67c1447f2c811191b79137b1ce8cc.tar.gz
samba-e55ff42229d67c1447f2c811191b79137b1ce8cc.tar.bz2
samba-e55ff42229d67c1447f2c811191b79137b1ce8cc.zip
r20168: start separating attributes and syntaxes
metze (This used to be commit 8dda4342f648aa71878ac9eeb7941710e2813aee)
Diffstat (limited to 'source4/lib/ldb/common/ldb_attributes.c')
-rw-r--r--source4/lib/ldb/common/ldb_attributes.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/source4/lib/ldb/common/ldb_attributes.c b/source4/lib/ldb/common/ldb_attributes.c
index d52264b90f..a0118d2452 100644
--- a/source4/lib/ldb/common/ldb_attributes.c
+++ b/source4/lib/ldb/common/ldb_attributes.c
@@ -149,15 +149,20 @@ void ldb_remove_attrib_handler(struct ldb_context *ldb, const char *attrib)
int ldb_set_attrib_handler_syntax(struct ldb_context *ldb,
const char *attr, const char *syntax)
{
- const struct ldb_attrib_handler *h = ldb_attrib_handler_syntax(ldb, syntax);
- struct ldb_attrib_handler h2;
- if (h == NULL) {
- ldb_debug(ldb, LDB_DEBUG_ERROR, "Unknown syntax '%s'\n", syntax);
+ const struct ldb_schema_syntax *s = ldb_standard_syntax_by_name(ldb, syntax);
+ struct ldb_attrib_handler h;
+ if (s == NULL) {
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "Unknown syntax '%s'\n", syntax);
return -1;
}
- h2 = *h;
- h2.attr = attr;
- return ldb_set_attrib_handlers(ldb, &h2, 1);
+ h.attr = attr;
+ h.flags = 0;
+ h.ldif_read_fn = s->ldif_read_fn;
+ h.ldif_write_fn = s->ldif_write_fn;
+ h.canonicalise_fn = s->canonicalise_fn;
+ h.comparison_fn = s->comparison_fn;
+
+ return ldb_set_attrib_handlers(ldb, &h, 1);
}
/*