svn commit: samba r16741 - in branches/SAMBA_4_0/source/torture/rpc: .

metze at samba.org metze at samba.org
Sat Jul 1 14:41:02 GMT 2006


Author: metze
Date: 2006-07-01 14:41:01 +0000 (Sat, 01 Jul 2006)
New Revision: 16741

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

Log:
add a RPC-LSA-GETUSER test,
which is very useful for analysing a windows machine remotely

with this I found that vista-beta2 doesn't have an 'administrator' account
and mapps any not known user to MACHINENAME\Guest

metze
Modified:
   branches/SAMBA_4_0/source/torture/rpc/lsa.c
   branches/SAMBA_4_0/source/torture/rpc/rpc.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/lsa.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/lsa.c	2006-07-01 14:36:04 UTC (rev 16740)
+++ branches/SAMBA_4_0/source/torture/rpc/lsa.c	2006-07-01 14:41:01 UTC (rev 16741)
@@ -1755,9 +1755,7 @@
 	return ret;
 }
 
-static BOOL test_GetUserName(struct dcerpc_pipe *p, 
-				  TALLOC_CTX *mem_ctx, 
-				  struct policy_handle *handle)
+static BOOL test_GetUserName(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
 {
 	struct lsa_GetUserName r;
 	NTSTATUS status;
@@ -1766,8 +1764,8 @@
 
 	printf("\nTesting GetUserName\n");
 
-	r.in.system_name = "\\";	
-	r.in.account_name = NULL;	
+	r.in.system_name = "\\";
+	r.in.account_name = NULL;
 	r.in.authority_name = &authority_name_p;
 	authority_name_p.string = NULL;
 
@@ -1873,10 +1871,6 @@
 			ret = False;
 		}
 		
-		if (!test_GetUserName(p, mem_ctx, handle)) {
-			ret = False;
-		}
-		
 #if 0
 		if (!test_Delete(p, mem_ctx, handle)) {
 			ret = False;
@@ -1895,8 +1889,36 @@
 			ret = False;
 		}
 	}
+
+	if (!test_GetUserName(p, mem_ctx)) {
+		ret = False;
+	}
 		
 	talloc_free(mem_ctx);
 
 	return ret;
 }
+
+BOOL torture_rpc_lsa_get_user(struct torture_context *torture)
+{
+        NTSTATUS status;
+        struct dcerpc_pipe *p;
+	TALLOC_CTX *mem_ctx;
+	BOOL ret = True;
+
+	mem_ctx = talloc_init("torture_rpc_lsa_get_user");
+
+	status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_lsarpc);
+	if (!NT_STATUS_IS_OK(status)) {
+		talloc_free(mem_ctx);
+		return False;
+	}
+
+	if (!test_GetUserName(p, mem_ctx)) {
+		ret = False;
+	}
+		
+	talloc_free(mem_ctx);
+
+	return ret;
+}

Modified: branches/SAMBA_4_0/source/torture/rpc/rpc.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/rpc.c	2006-07-01 14:36:04 UTC (rev 16740)
+++ branches/SAMBA_4_0/source/torture/rpc/rpc.c	2006-07-01 14:41:01 UTC (rev 16741)
@@ -97,6 +97,7 @@
 
 	register_torture_op("RPC-LSA", torture_rpc_lsa);
 	register_torture_op("RPC-LSALOOKUP", torture_rpc_lsa_lookup);
+	register_torture_op("RPC-LSA-GETUSER", torture_rpc_lsa_get_user);
 	register_torture_op("RPC-SECRETS", torture_rpc_lsa_secrets);
 	register_torture_op("RPC-ECHO", torture_rpc_echo);
 	register_torture_op("RPC-DFS", torture_rpc_dfs);



More information about the samba-cvs mailing list