1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

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 commit is contained in:
Stefan Metzmacher 2006-07-01 14:41:01 +00:00 committed by Gerald (Jerry) Carter
parent 6326bb901f
commit 97ae936275
2 changed files with 32 additions and 9 deletions

View File

@ -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);

View File

@ -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);