1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-14 12:23:52 +03:00

r20184: change ldb_attrib_handler into ldb_schema_attribute, which has a pointer

to a ldb_schema_syntax struct.

the default attribute handler is now registered dynamicly as "*"
attribute, instead of having its own code path.

ldb_schema_attribute's can be added to the ldb_schema given a
ldb_schema_syntax struct or the syntax name

we may also need to introduce a ldb_schema_matching_rule,
and add a pointer to a default ldb_schema_matching_rule
in the ldb_schema_syntax.

metze
This commit is contained in:
Stefan Metzmacher
2006-12-15 13:08:57 +00:00
committed by Gerald (Jerry) Carter
parent 1f67433914
commit b97b8f5dcb
16 changed files with 254 additions and 391 deletions

View File

@@ -171,17 +171,17 @@ static struct MprVar mprLdbMessage(struct ldb_context *ldb, struct ldb_message *
for (i=0;i<msg->num_elements;i++) {
struct ldb_message_element *el = &msg->elements[i];
struct MprVar val;
const struct ldb_attrib_handler *attr;
const struct ldb_schema_attribute *a;
struct ldb_val v;
attr = ldb_attrib_handler(ldb, el->name);
if (attr == NULL) {
a = ldb_schema_attribute_by_name(ldb, el->name);
if (a == NULL) {
goto failed;
}
if (el->num_values == 1 &&
!str_list_check_ci(multivalued, el->name)) {
if (attr->ldif_write_fn(ldb, msg, &el->values[0], &v) != 0) {
if (a->syntax->ldif_write_fn(ldb, msg, &el->values[0], &v) != 0) {
goto failed;
}
/* FIXME: nasty hack, remove me when ejs will support
@@ -195,8 +195,8 @@ static struct MprVar mprLdbMessage(struct ldb_context *ldb, struct ldb_message *
int j;
val = mprArray(el->name);
for (j=0;j<el->num_values;j++) {
if (attr->ldif_write_fn(ldb, msg,
&el->values[j], &v) != 0) {
if (a->syntax->ldif_write_fn(ldb, msg,
&el->values[j], &v) != 0) {
goto failed;
}
/* FIXME: nasty hack, remove me when ejs will support