patch for SAMR_QUERY_ALIASINFO level 1, samba-3.0.7

Jianliang Lu j.lu at tiesse.com
Wed Nov 10 09:16:44 GMT 2004


The SAMR_QUERY_ALIASINFO call for level1 should return the number of members
for that localgroup, not always 1.

Following is the patch :

--- samba-3.0.7/source/rpc_server/srv_samr_nt.c.orig	2004-11-10
09:38:38.000000000 +0100
+++ samba-3.0.7/source/rpc_server/srv_samr_nt.c	2004-11-10
09:39:37.000000000 +0100
@@ -1261,6 +1261,8 @@
 	struct acct_info info;
 	uint32    acc_granted;
 	BOOL ret;
+	nt num_sids = 0;
+        DOM_SID *sids=NULL;

 	r_u->status = NT_STATUS_OK;

@@ -1280,12 +1282,15 @@
 	if ( !ret )
 		return NT_STATUS_NO_SUCH_ALIAS;

+	if (!pdb_enum_aliasmem(&sid, &sids, &num_sids))
+                return NT_STATUS_NO_SUCH_ALIAS;
+
 	switch (q_u->switch_level) {
 	case 1:
 		r_u->ptr = 1;
 		r_u->ctr.switch_value1 = 1;
 		init_samr_alias_info1(&r_u->ctr.alias.info1,
-				      info.acct_name, 1, info.acct_desc);
+				      info.acct_name, num_sids, info.acct_desc);
 		break;
 	case 3:
 		r_u->ptr = 1;


Cheers,
Jianliang Lu

TieSse s.p.a
Via Jervis, 60 - 10015 Ivrea (To) - Italy
j.lu at tiesse.com
luj at libero.it
http://www.tiesse.com



More information about the samba-technical mailing list