diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-08-01 10:18:22 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-08-01 14:17:14 +0200 |
commit | 8b42f526f47bc8075b5a6f81b2293787ccb066bc (patch) | |
tree | 7de0eed0e26bc5f6ee13c1299528efe0898c0e0b | |
parent | 00cde56bfdf09cf71d2435f02280b44c2bb35183 (diff) | |
download | samba-8b42f526f47bc8075b5a6f81b2293787ccb066bc.tar.gz samba-8b42f526f47bc8075b5a6f81b2293787ccb066bc.tar.bz2 samba-8b42f526f47bc8075b5a6f81b2293787ccb066bc.zip |
s3:rpc_client: make use of smbXcli_session_application_key()
metze
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 8b9e513b00..bd4981316d 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -2862,9 +2862,22 @@ NTSTATUS cli_rpc_pipe_open_noauth_transport(struct cli_state *cli, auth->user_name = talloc_strdup(auth, cli->user_name); auth->domain = talloc_strdup(auth, cli->domain); - auth->user_session_key = data_blob_talloc(auth, - cli->user_session_key.data, - cli->user_session_key.length); + + if (transport == NCACN_NP) { + struct smbXcli_session *session; + + if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) { + session = cli->smb2.session; + } else { + session = cli->smb1.session; + } + + status = smbXcli_session_application_key(session, auth, + &auth->user_session_key); + if (!NT_STATUS_IS_OK(status)) { + auth->user_session_key = data_blob_null; + } + } if ((auth->user_name == NULL) || (auth->domain == NULL)) { TALLOC_FREE(result); |