From 99437614fa8028d60356ee79611d94051ec756ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Fri, 21 Jan 2011 16:58:32 +0100 Subject: [PATCH] s3-rpcclient: allow to define validation level for samlogon. Guenther --- source3/rpc_client/cli_netlogon.c | 2 +- source3/rpc_client/cli_netlogon.h | 1 + source3/rpcclient/cmd_netlogon.c | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c index 3046d277ee0..914bfd3df69 100644 --- a/source3/rpc_client/cli_netlogon.c +++ b/source3/rpc_client/cli_netlogon.c @@ -159,6 +159,7 @@ NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli, const char *username, const char *password, const char *workstation, + uint16_t validation_level, int logon_type) { NTSTATUS result = NT_STATUS_UNSUCCESSFUL; @@ -168,7 +169,6 @@ NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli, union netr_LogonLevel *logon; union netr_Validation validation; uint8_t authoritative; - int validation_level = 3; fstring clnt_name_slash; struct dcerpc_binding_handle *b = cli->binding_handle; diff --git a/source3/rpc_client/cli_netlogon.h b/source3/rpc_client/cli_netlogon.h index 107c222ceec..bb38b75b95c 100644 --- a/source3/rpc_client/cli_netlogon.h +++ b/source3/rpc_client/cli_netlogon.h @@ -15,6 +15,7 @@ NTSTATUS rpccli_netlogon_sam_logon(struct rpc_pipe_client *cli, const char *username, const char *password, const char *workstation, + uint16_t validation_level, int logon_type); NTSTATUS rpccli_netlogon_sam_network_logon(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c index 1942352939a..c909efe53fa 100644 --- a/source3/rpcclient/cmd_netlogon.c +++ b/source3/rpcclient/cmd_netlogon.c @@ -718,7 +718,7 @@ static NTSTATUS cmd_netlogon_sam_logon(struct rpc_pipe_client *cli, NTSTATUS result = NT_STATUS_UNSUCCESSFUL; int logon_type = NetlogonNetworkInformation; const char *username, *password; - int auth_level = 2; + uint16_t validation_level = 3; uint32 logon_param = 0; const char *workstation = NULL; @@ -740,14 +740,14 @@ static NTSTATUS cmd_netlogon_sam_logon(struct rpc_pipe_client *cli, sscanf(argv[4], "%i", &logon_type); if (argc >= 6) - sscanf(argv[5], "%i", &auth_level); + validation_level = atoi(argv[5]); if (argc == 7) sscanf(argv[6], "%x", &logon_param); /* Perform the sam logon */ - result = rpccli_netlogon_sam_logon(cli, mem_ctx, logon_param, lp_workgroup(), username, password, workstation, logon_type); + result = rpccli_netlogon_sam_logon(cli, mem_ctx, logon_param, lp_workgroup(), username, password, workstation, validation_level, logon_type); if (!NT_STATUS_IS_OK(result)) goto done; -- 2.34.1