summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-07-01 14:41:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:09:43 -0500
commit946e1c1b87d0cb88ae63f351c069b60bfcd34426 (patch)
tree14359e3162ecabe3f41d46b01d98101f93ebf587 /source4
parent21af3847a661a517e2ee848ff08bb932aa1e0e4b (diff)
downloadsamba-946e1c1b87d0cb88ae63f351c069b60bfcd34426.tar.gz
samba-946e1c1b87d0cb88ae63f351c069b60bfcd34426.tar.bz2
samba-946e1c1b87d0cb88ae63f351c069b60bfcd34426.zip
r16741: 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 (This used to be commit 97ae93627527f65b6ecded9884a26d4cffa1409d)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/lsa.c40
-rw-r--r--source4/torture/rpc/rpc.c1
2 files changed, 32 insertions, 9 deletions
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index 28b3b615ba..24f7bbbd01 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -1755,9 +1755,7 @@ static BOOL test_QueryInfoPolicy2(struct dcerpc_pipe *p,
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 @@ static BOOL test_GetUserName(struct dcerpc_pipe *p,
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 @@ BOOL torture_rpc_lsa(struct torture_context *torture)
ret = False;
}
- if (!test_GetUserName(p, mem_ctx, handle)) {
- ret = False;
- }
-
#if 0
if (!test_Delete(p, mem_ctx, handle)) {
ret = False;
@@ -1895,6 +1889,34 @@ BOOL torture_rpc_lsa(struct torture_context *torture)
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);
diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c
index 58a880f8e4..8d33560d65 100644
--- a/source4/torture/rpc/rpc.c
+++ b/source4/torture/rpc/rpc.c
@@ -97,6 +97,7 @@ NTSTATUS torture_rpc_init(void)
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);