1
0
mirror of https://github.com/samba-team/samba.git synced 2025-09-17 05:44:20 +03:00

r14495: Allow to play with the logon_param flag when testing samlogons.

Guenther
This commit is contained in:
Günther Deschner
2006-03-16 22:54:07 +00:00
committed by Gerald (Jerry) Carter
parent 5fdddffba5
commit 52d721b638

View File

@@ -294,45 +294,44 @@ static NTSTATUS cmd_netlogon_sam_deltas(struct rpc_pipe_client *cli,
/* Log on a domain user */ /* Log on a domain user */
static NTSTATUS cmd_netlogon_sam_logon(struct rpc_pipe_client *cli, static NTSTATUS cmd_netlogon_sam_logon(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc, TALLOC_CTX *mem_ctx, int argc,
const char **argv) const char **argv)
{ {
NTSTATUS result = NT_STATUS_UNSUCCESSFUL; NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
int logon_type = NET_LOGON_TYPE; int logon_type = NET_LOGON_TYPE;
const char *username, *password; const char *username, *password;
uint32 neg_flags = 0x000001ff;
int auth_level = 2; int auth_level = 2;
uint32 logon_param = 0;
/* Check arguments */ /* Check arguments */
if (argc < 3 || argc > 6) { if (argc < 3 || argc > 6) {
fprintf(stderr, "Usage: samlogon <username> <password> " fprintf(stderr, "Usage: samlogon <username> <password> "
"[logon_type] [neg flags] [auth level (2 or 3)]\n" "[logon_type (1 or 2)] [auth level (2 or 3)] [logon_parameter]\n");
"neg flags being 0x000001ff or 0x6007ffff\n"); return NT_STATUS_OK;
return NT_STATUS_OK; }
}
username = argv[1]; username = argv[1];
password = argv[2]; password = argv[2];
if (argc >= 4) if (argc >= 4)
sscanf(argv[3], "%i", &logon_type); sscanf(argv[3], "%i", &logon_type);
if (argc >= 5) if (argc >= 5)
sscanf(argv[4], "%i", &neg_flags); sscanf(argv[4], "%i", &auth_level);
if (argc == 6) if (argc == 6)
sscanf(argv[5], "%i", &auth_level); sscanf(argv[5], "%x", &logon_param);
/* Perform the sam logon */ /* Perform the sam logon */
result = rpccli_netlogon_sam_logon(cli, mem_ctx, 0, lp_workgroup(), username, password, logon_type); result = rpccli_netlogon_sam_logon(cli, mem_ctx, logon_param, lp_workgroup(), username, password, logon_type);
if (!NT_STATUS_IS_OK(result)) if (!NT_STATUS_IS_OK(result))
goto done; goto done;
done: done:
return result; return result;
} }
/* Change the trust account password */ /* Change the trust account password */