From 862d7e32b90f7020d46e025de918f6338f40441b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 21 Apr 2008 22:27:29 +0200 Subject: Move user/domain from rpc_pipe_client to cli_pipe_auth_data (This used to be commit 42de50d2cd43e760d776694f7b5f003ba51d7f84) --- source3/rpc_client/cli_pipe.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'source3/rpc_client/cli_pipe.c') diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 8c540ee6fd..14ee78202a 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -1067,14 +1067,15 @@ static NTSTATUS create_schannel_auth_rpc_bind_req( struct rpc_pipe_client *cli, /* Use lp_workgroup() if domain not specified */ - if (!cli->domain || !cli->domain[0]) { - cli->domain = talloc_strdup(cli, lp_workgroup()); - if (cli->domain == NULL) { + 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; } } - init_rpc_auth_schannel_neg(&schannel_neg, cli->domain, global_myname()); + init_rpc_auth_schannel_neg(&schannel_neg, cli->auth->domain, + global_myname()); /* * Now marshall the data into the auth parse_struct. @@ -2235,14 +2236,14 @@ static struct rpc_pipe_client *cli_rpc_pipe_open(struct cli_state *cli, int pipe result->auth->auth_type = PIPE_AUTH_TYPE_NONE; result->auth->auth_level = PIPE_AUTH_LEVEL_NONE; - result->domain = talloc_strdup(result, cli->domain); - result->user_name = talloc_strdup(result, cli->user_name); + result->auth->domain = talloc_strdup(result, cli->domain); + result->auth->user_name = talloc_strdup(result, cli->user_name); result->desthost = talloc_strdup(result, cli->desthost); result->srv_name_slash = talloc_asprintf_strupper_m( result, "\\\\%s", result->desthost); - if ((result->domain == NULL) - || (result->user_name == NULL) + if ((result->auth->domain == NULL) + || (result->auth->user_name == NULL) || (result->desthost == NULL) || (result->srv_name_slash == NULL)) { *perr = NT_STATUS_NO_MEMORY; @@ -2349,13 +2350,14 @@ static struct rpc_pipe_client *cli_rpc_pipe_open_ntlmssp_internal(struct cli_sta result->auth->cli_auth_data_free_func = cli_ntlmssp_auth_free; - TALLOC_FREE(result->domain); - TALLOC_FREE(result->user_name); + TALLOC_FREE(result->auth->domain); + TALLOC_FREE(result->auth->user_name); - result->domain = talloc_strdup(result, domain); - result->user_name = talloc_strdup(result, username); + result->auth->domain = talloc_strdup(result, domain); + result->auth->user_name = talloc_strdup(result, username); - if ((result->domain == NULL) || (result->user_name == NULL)) { + if ((result->auth->domain == NULL) + || (result->auth->user_name == NULL)) { *perr = NT_STATUS_NO_MEMORY; goto err; } @@ -2570,9 +2572,9 @@ struct rpc_pipe_client *cli_rpc_pipe_open_schannel_with_key(struct cli_state *cl return NULL; } - TALLOC_FREE(result->domain); - result->domain = talloc_strdup(result, domain); - if (result->domain == NULL) { + TALLOC_FREE(result->auth->domain); + result->auth->domain = talloc_strdup(result, domain); + if (result->auth->domain == NULL) { TALLOC_FREE(result); *perr = NT_STATUS_NO_MEMORY; return NULL; -- cgit