svn commit: samba r7507 - in branches/SAMBA_4_0/source: rpc_server/samr torture/rpc

tridge at samba.org tridge at samba.org
Sun Jun 12 11:03:15 GMT 2005


Author: tridge
Date: 2005-06-12 11:03:15 +0000 (Sun, 12 Jun 2005)
New Revision: 7507

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

Log:
fixed the problem with users being shown too many times in acl
editors, and added a test for it.

Modified:
   branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c
   branches/SAMBA_4_0/source/torture/rpc/samr.c


Changeset:
Modified: branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c	2005-06-12 07:48:53 UTC (rev 7506)
+++ branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c	2005-06-12 11:03:15 UTC (rev 7507)
@@ -2965,7 +2965,7 @@
 
 		switch(r->in.level) {
 		case 1:
-			entriesGeneral[count].idx = count;
+			entriesGeneral[count].idx = count + 1;
 			entriesGeneral[count].rid = 
 				objectsid->sub_auths[objectsid->num_auths-1];
 			entriesGeneral[count].acct_flags =
@@ -2981,7 +2981,7 @@
 			break;
 		case 2:
 		case 3:
-			entriesFull[count].idx = count;
+			entriesFull[count].idx = count + 1;
 			entriesFull[count].rid =
 				objectsid->sub_auths[objectsid->num_auths-1];
 			entriesFull[count].acct_flags =
@@ -2999,7 +2999,7 @@
 			break;
 		case 4:
 		case 5:
-			entriesAscii[count].idx = count;
+			entriesAscii[count].idx = count + 1;
 			entriesAscii[count].account_name.string =
 				samdb_result_string(res[i], "sAMAccountName",
 						    "");

Modified: branches/SAMBA_4_0/source/torture/rpc/samr.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/samr.c	2005-06-12 07:48:53 UTC (rev 7506)
+++ branches/SAMBA_4_0/source/torture/rpc/samr.c	2005-06-12 11:03:15 UTC (rev 7507)
@@ -2479,6 +2479,50 @@
 	return ret;	
 }
 
+
+static BOOL test_QueryDisplayInfo_continue(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 
+					   struct policy_handle *handle)
+{
+	NTSTATUS status;
+	struct samr_QueryDisplayInfo r;
+	BOOL ret = True;
+	uint16_t levels[] = {1, 2, 3, 4, 5};
+	int i;
+
+	printf("Testing QueryDisplayInfo continuation\n");
+
+	r.in.domain_handle = handle;
+	r.in.level = 1;
+	r.in.start_idx = 0;
+	r.in.max_entries = 1;
+	r.in.buf_size = (uint32_t)-1;
+
+	do {
+		status = dcerpc_samr_QueryDisplayInfo(p, mem_ctx, &r);
+		if (NT_STATUS_IS_OK(status) && r.out.returned_size != 0) {
+			if (r.out.info.info1.entries[0].idx != r.in.start_idx + 1) {
+				printf("failed: expected idx %d but got %d\n",
+				       r.in.start_idx + 1,
+				       r.out.info.info1.entries[0].idx);
+				ret = False;
+				break;
+			}
+		}
+		if (!NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES) &&
+		    !NT_STATUS_IS_OK(status)) {
+			printf("QueryDisplayInfo level %u failed - %s\n", 
+			       r.in.level, nt_errstr(status));
+			ret = False;
+			break;
+		}
+		r.in.start_idx++;
+	} while (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES) ||
+		 NT_STATUS_IS_OK(status) &&
+		 r.out.returned_size != 0);
+	
+	return ret;	
+}
+
 static BOOL test_QueryDomainInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 
 				 struct policy_handle *handle)
 {
@@ -2958,6 +3002,7 @@
 	ret &= test_QueryDisplayInfo(p, mem_ctx, &domain_handle);
 	ret &= test_QueryDisplayInfo2(p, mem_ctx, &domain_handle);
 	ret &= test_QueryDisplayInfo3(p, mem_ctx, &domain_handle);
+	ret &= test_QueryDisplayInfo_continue(p, mem_ctx, &domain_handle);
 	ret &= test_GetDisplayEnumerationIndex(p, mem_ctx, &domain_handle);
 	ret &= test_GetDisplayEnumerationIndex2(p, mem_ctx, &domain_handle);
 	ret &= test_GroupList(p, mem_ctx, &domain_handle);



More information about the samba-cvs mailing list