diff options
author | Kamen Mazdrashki <kamen.mazdrashki@postpath.com> | 2009-11-22 17:48:32 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-11-23 14:15:06 +0100 |
commit | cf2bb28014b2687bc5d971bf47f57aeb75b600c0 (patch) | |
tree | b400126a4ece33cfa7c5ee5712a41ce468f68975 /source4/dsdb/samdb | |
parent | 1bf31f343c1e01b970a9f887bf7a8bac6334e54a (diff) | |
download | samba-cf2bb28014b2687bc5d971bf47f57aeb75b600c0.tar.gz samba-cf2bb28014b2687bc5d971bf47f57aeb75b600c0.tar.bz2 samba-cf2bb28014b2687bc5d971bf47f57aeb75b600c0.zip |
s4/schema: Handle Object(OR-Name) syntax in extended_dn_out module
Windows displays attribute values with Object(OR-Name) syntax
in plain DN format when queried through LDAP.
Hence, we need to post-process such values specially
in extended_dn_out.c module so they are always shown as plain DN,
no matter what controls are passed for search request.
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/extended_dn_out.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c index 1249a9cdfa..c52953c206 100644 --- a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c +++ b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c @@ -398,6 +398,7 @@ static int extended_callback(struct ldb_request *req, struct ldb_reply *ares, /* Walk the retruned elements (but only if we have a schema to interpret the list with) */ for (i = 0; ac->schema && i < msg->num_elements; i++) { + bool make_extended_dn; const struct dsdb_attribute *attribute; attribute = dsdb_attribute_by_lDAPDisplayName(ac->schema, msg->elements[i].name); if (!attribute) { @@ -425,6 +426,13 @@ static int extended_callback(struct ldb_request *req, struct ldb_reply *ares, continue; } + make_extended_dn = ac->inject; + + /* Always show plain DN in case of Object(OR-Name) syntax */ + if (make_extended_dn) { + make_extended_dn = (strcmp(attribute->syntax->ldap_oid, DSDB_SYNTAX_OR_NAME) != 0); + } + for (j = 0; j < msg->elements[i].num_values; j++) { const char *dn_str; struct ldb_dn *dn; @@ -470,12 +478,12 @@ static int extended_callback(struct ldb_request *req, struct ldb_reply *ares, } } - if (!ac->inject) { + if (make_extended_dn) { + dn_str = dsdb_dn_get_extended_linearized(msg->elements[i].values, + dsdb_dn, ac->extended_type); + } else { dn_str = dsdb_dn_get_linearized(msg->elements[i].values, dsdb_dn); - } else { - dn_str = dsdb_dn_get_extended_linearized(msg->elements[i].values, - dsdb_dn, ac->extended_type); } if (!dn_str) { |