svn commit: samba r7055 - in branches/SAMBA_4_0/source/web_server: .

tridge at samba.org tridge at samba.org
Sat May 28 08:59:46 GMT 2005


Author: tridge
Date: 2005-05-28 08:59:46 +0000 (Sat, 28 May 2005)
New Revision: 7055

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7055

Log:
automatically add the dn to all ldbSearch results


Modified:
   branches/SAMBA_4_0/source/web_server/calls.c


Changeset:
Modified: branches/SAMBA_4_0/source/web_server/calls.c
===================================================================
--- branches/SAMBA_4_0/source/web_server/calls.c	2005-05-28 08:48:57 UTC (rev 7054)
+++ branches/SAMBA_4_0/source/web_server/calls.c	2005-05-28 08:59:46 UTC (rev 7055)
@@ -78,11 +78,12 @@
 	   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 @@
 		}
 		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;		
 }



More information about the samba-cvs mailing list