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

metze at samba.org metze at samba.org
Tue Dec 21 09:41:21 GMT 2004


Author: metze
Date: 2004-12-21 09:41:21 +0000 (Tue, 21 Dec 2004)
New Revision: 4309

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

Log:
idl and torture test for lsa_GetUserName()

why does samba3 return domain_name as in the unknown_name field in the code
and on the wire it returns DCERPC_FAULT_OP_RNG_ERROR?

all of my test machines NT4,W2K,W2K3,XP returned NULL

and if I file the string in the .in.* the server echos the strings back 
and returns NT_STATUS_INVALID_PARAMETER

metze

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


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/lsa.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/lsa.idl	2004-12-21 09:33:12 UTC (rev 4308)
+++ branches/SAMBA_4_0/source/librpc/idl/lsa.idl	2004-12-21 09:41:21 UTC (rev 4309)
@@ -649,9 +649,17 @@
 		[out,ref] policy_handle *handle
 		);
 
+	/**********************/
+	/* Function:     0x2d */
+	typedef struct {
+		lsa_String *string;
+	} lsa_StringPointer;
 
-	/* Function:    0x2d */
-	NTSTATUS lsa_GetUserName();
+	NTSTATUS lsa_GetUserName(
+		[in] unistr *system_name,
+		[in,out] lsa_String *account_name,
+		[in,out] lsa_StringPointer *unknown_name
+		);
 
 	/**********************/
 	/* Function:          0x2e */

Modified: branches/SAMBA_4_0/source/torture/rpc/lsa.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/lsa.c	2004-12-21 09:33:12 UTC (rev 4308)
+++ branches/SAMBA_4_0/source/torture/rpc/lsa.c	2004-12-21 09:41:21 UTC (rev 4309)
@@ -1138,6 +1138,29 @@
 	return ret;
 }
 
+static BOOL test_GetUserName(struct dcerpc_pipe *p, 
+				  TALLOC_CTX *mem_ctx, 
+				  struct policy_handle *handle)
+{
+	struct lsa_GetUserName r;
+	NTSTATUS status;
+	BOOL ret = True;
+	printf("\nTesting GetUserName\n");
+
+	r.in.system_name = "\\";	
+	r.in.account_name = NULL;	
+	r.in.unknown_name = NULL;
+
+	status = dcerpc_lsa_GetUserName(p, mem_ctx, &r);
+
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("GetUserName failed - %s\n", nt_errstr(status));
+		ret = False;
+	}
+
+	return ret;
+}
+
 static BOOL test_Close(struct dcerpc_pipe *p, 
 		       TALLOC_CTX *mem_ctx, 
 		       struct policy_handle *handle)
@@ -1230,7 +1253,11 @@
 	if (!test_QueryInfoPolicy2(p, mem_ctx, &handle)) {
 		ret = False;
 	}
-	
+
+	if (!test_GetUserName(p, mem_ctx, &handle)) {
+		ret = False;
+	}
+
 #if 0
 	if (!test_Delete(p, mem_ctx, &handle)) {
 		ret = False;



More information about the samba-cvs mailing list