svn commit: samba r2833 - in branches/SAMBA_4_0/source: librpc/idl torture/rpc

tridge at samba.org tridge at samba.org
Thu Oct 7 03:47:38 GMT 2004


Author: tridge
Date: 2004-10-07 03:47:38 +0000 (Thu, 07 Oct 2004)
New Revision: 2833

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=2833&nolog=1

Log:
- added a call to SamrQueryGroupMember for every group, and fix the
  IDL so this works (the previous IDL was bogus)

- changed a hyper to uint64 after looking at output on cascade on sparc



Modified:
   branches/SAMBA_4_0/source/librpc/idl/samr.idl
   branches/SAMBA_4_0/source/torture/rpc/samr.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/samr.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/samr.idl	2004-10-06 16:21:35 UTC (rev 2832)
+++ branches/SAMBA_4_0/source/librpc/idl/samr.idl	2004-10-07 03:47:38 UTC (rev 2833)
@@ -148,7 +148,7 @@
 		samr_Name comment;
 		samr_Name domain;  /* domain name */
 		samr_Name primary; /* PDC name if this is a BDC */
-		HYPER_T sequence_num;
+		uint64 sequence_num;
 		uint32 unknown2;
 		uint32 role;
 		uint32 unknown3;
@@ -190,17 +190,7 @@
 	} samr_DomInfo9;
 
 	typedef struct {
-		uint64 force_logoff_time;
-		samr_Name comment;
-		samr_Name domain;
-		samr_Name primary;
-		HYPER_T sequence_num;
-		uint32 unknown2;  /* w2k3 returns 1 */
-		uint32 role;
-		uint32 unknown3;  /* w2k3 returns 1 */
-		uint32 num_users;
-		uint32 num_groups;
-		uint32 num_aliases;
+		samr_DomInfo2 info2;
 		HYPER_T lockout_duration;
 		HYPER_T lockout_window;
 		uint16 lockout_threshold;
@@ -405,10 +395,11 @@
 	} samr_GroupInfoDesciption;
 
 	typedef enum {
-		GroupInfoAll = 1,
-		GroupInfoName,
-		GroupInfoX,
-		GroupInfoDescription
+		GroupInfoAll          = 1,
+		GroupInfoName         = 2,
+		GroupInfoX            = 3,
+		GroupInfoDescription  = 4,
+		GroupInfoAll2         = 5
 	} GroupInfo;
 
 	typedef union {
@@ -416,6 +407,7 @@
 		[case(GroupInfoName)]        samr_Name            name;
 		[case(GroupInfoX)]           samr_GroupInfoX      unknown;
 		[case(GroupInfoDescription)] samr_Name            description;
+		[case(GroupInfoAll2)]        samr_GroupInfoAll    all2;
 	} samr_GroupInfo;
 
 	NTSTATUS samr_QueryGroupInfo(
@@ -456,24 +448,15 @@
 
 	/************************/
 	/* Function    0x19     */
-	/*
-	  this isn't really valid IDL, but it does work. I suspect
-	  I need to do some more pidl work to get this really right
-	*/
 	typedef struct {
 		uint32 count;
-		uint32 v[count];
-	} samr_intArray;
-
-	typedef struct {
-		samr_intArray *rids;
-		samr_intArray *unknown7;
+		[size_is(count)] uint32 *rids;
+		[size_is(count)] uint32 *unknown;
 	} samr_ridArray;
 
 	NTSTATUS samr_QueryGroupMember(
 		[in,ref]  policy_handle *group_handle,
-		[out]     uint32 *count,
-		[out]     samr_ridArray rids
+		[out]     samr_ridArray *rids
 		);
 
 

Modified: branches/SAMBA_4_0/source/torture/rpc/samr.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/samr.c	2004-10-06 16:21:35 UTC (rev 2832)
+++ branches/SAMBA_4_0/source/torture/rpc/samr.c	2004-10-07 03:47:38 UTC (rev 2833)
@@ -1653,7 +1653,7 @@
 {
 	NTSTATUS status;
 	struct samr_QueryGroupInfo r;
-	uint16_t levels[] = {1, 2, 3, 4};
+	uint16_t levels[] = {1, 2, 3, 4, 5};
 	int i;
 	BOOL ret = True;
 
@@ -1674,7 +1674,27 @@
 	return ret;
 }
 
+static BOOL test_QueryGroupMember(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 
+				  struct policy_handle *handle)
+{
+	NTSTATUS status;
+	struct samr_QueryGroupMember r;
+	BOOL ret = True;
 
+	printf("Testing QueryGroupMember\n");
+
+	r.in.group_handle = handle;
+
+	status = dcerpc_samr_QueryGroupMember(p, mem_ctx, &r);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("QueryGroupInfo failed - %s\n", nt_errstr(status));
+		ret = False;
+	}
+
+	return ret;
+}
+
+
 static BOOL test_SetGroupInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 
 			      struct policy_handle *handle)
 {
@@ -1871,6 +1891,10 @@
 		ret = False;
 	}
 
+	if (!test_QueryGroupMember(p, mem_ctx, &group_handle)) {
+		ret = False;
+	}
+
 	if (!test_Close(p, mem_ctx, &group_handle)) {
 		ret = False;
 	}



More information about the samba-cvs mailing list