summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-08-02 13:28:59 +0200
committerStefan Metzmacher <metze@samba.org>2013-08-10 09:18:57 +0200
commit838cb539621ef19cac6badb4b10678dcc3a6f68a (patch)
treec534053d2ccd62937cc51ebfb1f2e1c3126642cf /source3/rpc_client
parente96142fc439efb7c90719f9c387778c4218ae637 (diff)
downloadsamba-838cb539621ef19cac6badb4b10678dcc3a6f68a.tar.gz
samba-838cb539621ef19cac6badb4b10678dcc3a6f68a.tar.bz2
samba-838cb539621ef19cac6badb4b10678dcc3a6f68a.zip
s3:cli_pipe: pass down creds->computer_name to NL_AUTH_MESSAGE
We need to use the same computer_name value as in the netr_Authenticate3() request. We abuse cli->auth->user_name to pass the value down. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_pipe.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 4d8a9d3b03..1c66bb3963 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -1003,13 +1003,12 @@ static NTSTATUS create_schannel_auth_rpc_bind_req(struct rpc_pipe_client *cli,
NTSTATUS status;
struct NL_AUTH_MESSAGE r;
- /* Use lp_workgroup() if domain not specified */
+ if (!cli->auth->user_name || !cli->auth->user_name[0]) {
+ return NT_STATUS_INVALID_PARAMETER_MIX;
+ }
if (!cli->auth->domain || !cli->auth->domain[0]) {
- cli->auth->domain = talloc_strdup(cli, lp_workgroup());
- if (cli->auth->domain == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
+ return NT_STATUS_INVALID_PARAMETER_MIX;
}
/*
@@ -1020,7 +1019,7 @@ static NTSTATUS create_schannel_auth_rpc_bind_req(struct rpc_pipe_client *cli,
r.Flags = NL_FLAG_OEM_NETBIOS_DOMAIN_NAME |
NL_FLAG_OEM_NETBIOS_COMPUTER_NAME;
r.oem_netbios_domain.a = cli->auth->domain;
- r.oem_netbios_computer.a = lp_netbios_name();
+ r.oem_netbios_computer.a = cli->auth->user_name;
status = dcerpc_push_schannel_bind(cli, &r, auth_token);
if (!NT_STATUS_IS_OK(status)) {
@@ -2237,7 +2236,7 @@ static NTSTATUS rpccli_schannel_bind_data(TALLOC_CTX *mem_ctx,
result->auth_type = DCERPC_AUTH_TYPE_SCHANNEL;
result->auth_level = auth_level;
- result->user_name = talloc_strdup(result, "");
+ result->user_name = talloc_strdup(result, creds->computer_name);
result->domain = talloc_strdup(result, domain);
if ((result->user_name == NULL) || (result->domain == NULL)) {
goto fail;