summaryrefslogtreecommitdiffstats
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-09-16 20:53:51 +0200
committerStefan Metzmacher <metze@samba.org>2014-01-07 12:47:15 +0100
commit660150b12a637da7f9ebb820e687f27ac22fb93a (patch)
tree49945d99f4351a692bab2576479b30b1bd41b5c3 /source3/rpc_client
parenta34c837fdb59df1e66be9b5f23a07990e34fea1c (diff)
downloadsamba-660150b12a637da7f9ebb820e687f27ac22fb93a.tar.gz
samba-660150b12a637da7f9ebb820e687f27ac22fb93a.tar.xz
samba-660150b12a637da7f9ebb820e687f27ac22fb93a.zip
s3:rpc_client: make cli_rpc_pipe_open_schannel() more flexible
It expects a messaging_context now and returns a netlogon_creds_cli_context. This way we can finally avoid having a rpc_pipe_client->netlogon_creds. 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.h5
-rw-r--r--source3/rpc_client/cli_pipe_schannel.c9
2 files changed, 11 insertions, 3 deletions
diff --git a/source3/rpc_client/cli_pipe.h b/source3/rpc_client/cli_pipe.h
index 51bf1821a3..533e752ced 100644
--- a/source3/rpc_client/cli_pipe.h
+++ b/source3/rpc_client/cli_pipe.h
@@ -101,11 +101,14 @@ NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli,
struct rpc_pipe_client **presult);
NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
+ struct messaging_context *msg_ctx,
const struct ndr_interface_table *table,
enum dcerpc_transport_t transport,
enum dcerpc_AuthLevel auth_level,
const char *domain,
- struct rpc_pipe_client **presult);
+ struct rpc_pipe_client **presult,
+ TALLOC_CTX *mem_ctx,
+ struct netlogon_creds_cli_context **pcreds);
NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client *cli,
diff --git a/source3/rpc_client/cli_pipe_schannel.c b/source3/rpc_client/cli_pipe_schannel.c
index 1fcf62ef86..a8423337cb 100644
--- a/source3/rpc_client/cli_pipe_schannel.c
+++ b/source3/rpc_client/cli_pipe_schannel.c
@@ -38,14 +38,16 @@
****************************************************************************/
NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
+ struct messaging_context *msg_ctx,
const struct ndr_interface_table *table,
enum dcerpc_transport_t transport,
enum dcerpc_AuthLevel auth_level,
const char *domain,
- struct rpc_pipe_client **presult)
+ struct rpc_pipe_client **presult,
+ TALLOC_CTX *mem_ctx,
+ struct netlogon_creds_cli_context **pcreds)
{
TALLOC_CTX *frame = talloc_stackframe();
- struct messaging_context *msg_ctx = NULL;
const char *dc_name = smbXcli_conn_remote_name(cli->conn);
struct rpc_pipe_client *result = NULL;
NTSTATUS status;
@@ -121,6 +123,9 @@ NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
if (NT_STATUS_IS_OK(status)) {
*presult = result;
+ if (pcreds != NULL) {
+ *pcreds = talloc_move(mem_ctx, &netlogon_creds);
+ }
}
TALLOC_FREE(frame);