summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>2009-11-22 17:48:32 +0200
committerStefan Metzmacher <metze@samba.org>2009-11-23 14:15:06 +0100
commitcf2bb28014b2687bc5d971bf47f57aeb75b600c0 (patch)
treeb400126a4ece33cfa7c5ee5712a41ce468f68975
parent1bf31f343c1e01b970a9f887bf7a8bac6334e54a (diff)
downloadsamba-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.
-rw-r--r--source4/dsdb/samdb/ldb_modules/extended_dn_out.c16
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) {