svn commit: samba r19516 - in branches/SAMBA_3_0/source/groupdb: .

idra at samba.org idra at samba.org
Tue Oct 31 12:57:56 GMT 2006


Author: idra
Date: 2006-10-31 12:57:56 +0000 (Tue, 31 Oct 2006)
New Revision: 19516

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

Log:

Fix the DN, to make searches using the domain as base
the DN must be rid,domain and not domain,rid

Also use member and not memberOf for group members
following conventions.


Modified:
   branches/SAMBA_3_0/source/groupdb/mapping_ldb.c


Changeset:
Modified: branches/SAMBA_3_0/source/groupdb/mapping_ldb.c
===================================================================
--- branches/SAMBA_3_0/source/groupdb/mapping_ldb.c	2006-10-30 14:06:06 UTC (rev 19515)
+++ branches/SAMBA_3_0/source/groupdb/mapping_ldb.c	2006-10-31 12:57:56 UTC (rev 19516)
@@ -44,7 +44,7 @@
 		  "dn: @INDEXLIST\n" \
 		  "@IDXATTR: gidNumber\n" \
 		  "@IDXATTR: ntName\n" \
-		  "@IDXATTR: memberOf\n" };
+		  "@IDXATTR: member\n" };
 	const char *db_path, *tdb_path;
 	int ret;
 	int flags = 0;
@@ -121,8 +121,8 @@
 	}
 	/* we split by domain and rid so we can do a subtree search
 	   when we only want one domain */
-	return ldb_dn_string_compose(mem_ctx, NULL, "domain=%s,rid=%u", 
-				     string_sid, rid);
+	return ldb_dn_string_compose(mem_ctx, NULL, "rid=%u,domain=%s", 
+				     rid, string_sid);
 }
 
 /*
@@ -405,7 +405,7 @@
 		return NT_STATUS_INVALID_PARAMETER;
 	}
 
-	expr = talloc_asprintf(ldb, "(&(memberOf=%s)(objectClass=groupMap))", 
+	expr = talloc_asprintf(ldb, "(&(member=%s)(objectClass=groupMap))", 
 			       string_sid);
 	if (expr == NULL) goto failed;
 
@@ -439,7 +439,7 @@
 }
 
 /*
-  add/remove a memberOf field
+  add/remove a member field
 */
 static NTSTATUS modify_aliasmem(const DOM_SID *alias, const DOM_SID *member,
 				int operation)
@@ -479,7 +479,7 @@
 	msg.num_elements = 1;
 	msg.elements = ⪙
 	el.flags = operation;
-	el.name = talloc_strdup(tmp_ctx, "memberOf");
+	el.name = talloc_strdup(tmp_ctx, "member");
 	el.num_values = 1;
 	el.values = &val;
 	sid_to_string(string_sid, member);
@@ -513,12 +513,12 @@
 
 
 /*
-  enumerate sids that have the given alias set in memberOf
+  enumerate sids that have the given alias set in member
 */
  NTSTATUS enum_aliasmem(const DOM_SID *alias, DOM_SID **sids, size_t *num)
 {
 	const char *attrs[] = {
-		"memberOf",
+		"member",
 		NULL
 	};
 	int ret, i;
@@ -549,7 +549,7 @@
 		return NT_STATUS_INTERNAL_DB_CORRUPTION;
 	}
 
-	el = ldb_msg_find_element(res->msgs[0], "memberOf");
+	el = ldb_msg_find_element(res->msgs[0], "member");
 	if (el == NULL) {
 		talloc_free(dn);
 		return NT_STATUS_INTERNAL_DB_CORRUPTION;



More information about the samba-cvs mailing list