svn commit: samba r17076 - in branches/SOC/mkhl/ldb-map/modules: .

mkhl at samba.org mkhl at samba.org
Sun Jul 16 00:29:36 GMT 2006


Author: mkhl
Date: 2006-07-16 00:29:35 +0000 (Sun, 16 Jul 2006)
New Revision: 17076

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

Log:
When searching for specific local attributes, always search for the
IS_MAPPED attribute as well so we can include data from the remote
partition.

Martin

Modified:
   branches/SOC/mkhl/ldb-map/modules/ldb_map.c


Changeset:
Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c
===================================================================
--- branches/SOC/mkhl/ldb-map/modules/ldb_map.c	2006-07-15 20:39:00 UTC (rev 17075)
+++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c	2006-07-16 00:29:35 UTC (rev 17076)
@@ -1510,9 +1510,27 @@
 		const char ***remote_attrs,
 		const char * const *attrs)
 {
-	
+	int last;
+
 	*local_attrs = select_unmapped_attrs(module, local_ctx, attrs);
 	*remote_attrs = select_mapped_attrs(module, remote_ctx, attrs);
+
+	if (*local_attrs == NULL)
+		return LDB_SUCCESS;
+
+	/* if specific local attrs were requested */
+	/* find last local attribute */
+	for (last = 0; (*local_attrs)[last]; last++);
+
+	/* add IS_MAPPED behind it */
+	*local_attrs = talloc_realloc(local_ctx, *local_attrs,
+				      const char *, last+2);
+	if (*local_attrs == NULL)
+		return LDB_ERR_OPERATIONS_ERROR;
+
+	(*local_attrs)[last] = talloc_strdup(*local_attrs, IS_MAPPED);
+	(*local_attrs)[last+1] = NULL;
+
 	return LDB_SUCCESS;
 }
 



More information about the samba-cvs mailing list