summaryrefslogtreecommitdiff
path: root/source4/web_server
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-05-28 08:59:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:09 -0500
commitc77ea0c10096daf112ce1765742ee9595959a6b2 (patch)
treee410aee70b623f89afa2f90672e0366369cd6d09 /source4/web_server
parent2e315315e58b666b89ae205cc60c6a39a20915fe (diff)
downloadsamba-c77ea0c10096daf112ce1765742ee9595959a6b2.tar.gz
samba-c77ea0c10096daf112ce1765742ee9595959a6b2.tar.bz2
samba-c77ea0c10096daf112ce1765742ee9595959a6b2.zip
r7055: automatically add the dn to all ldbSearch results
(This used to be commit d6fa28080831700f80ff46320e0b0831337b822a)
Diffstat (limited to 'source4/web_server')
-rw-r--r--source4/web_server/calls.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source4/web_server/calls.c b/source4/web_server/calls.c
index 3626f33981..fc23a113fe 100644
--- a/source4/web_server/calls.c
+++ b/source4/web_server/calls.c
@@ -78,11 +78,12 @@ static struct MprVar mprLdbMessage(struct ldb_message *msg)
need a special case for the single value case */
const char *multivalued[] = { "objectClass", "memberOf", "privilege",
"member", NULL };
+ struct MprVar val;
var = mprCreateObjVar(msg->dn, ESP_HASH_SIZE);
+
for (i=0;i<msg->num_elements;i++) {
struct ldb_message_element *el = &msg->elements[i];
- struct MprVar val;
if (el->num_values == 1 &&
!str_list_check_ci(multivalued, el->name)) {
val = mprData(el->values[0].data, el->values[0].length);
@@ -97,6 +98,12 @@ static struct MprVar mprLdbMessage(struct ldb_message *msg)
}
mprCreateProperty(&var, el->name, &val);
}
+
+ /* add the dn if it is not already specified */
+ if (mprGetProperty(&var, "dn", 0) == 0) {
+ val = mprCreateStringVar(msg->dn, 1);
+ mprCreateProperty(&var, "dn", &val);
+ }
return var;
}