From a4faf57b47095bfc0f4370ac093c8c4cef17584f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 6 Sep 2013 13:06:53 +0200 Subject: s3:rpc_client: remove unused rpccli_netlogon_setup_creds() Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source3/rpc_client/cli_netlogon.c | 92 --------------------------------------- source3/rpc_client/cli_netlogon.h | 8 ---- 2 files changed, 100 deletions(-) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c index 2f23d1b8ea..687d0c2082 100644 --- a/source3/rpc_client/cli_netlogon.c +++ b/source3/rpc_client/cli_netlogon.c @@ -35,98 +35,6 @@ #include "lib/param/param.h" #include "libcli/smb/smbXcli_base.h" -/**************************************************************************** - Wrapper function that uses the auth and auth2 calls to set up a NETLOGON - credentials chain. Stores the credentials in the struct dcinfo in the - netlogon pipe struct. -****************************************************************************/ - -NTSTATUS rpccli_netlogon_setup_creds(struct rpc_pipe_client *cli, - const char *server_name, - const char *domain, - const char *clnt_name, - const char *machine_account, - const unsigned char machine_pwd[16], - enum netr_SchannelType sec_chan_type, - uint32_t *neg_flags_inout) -{ - TALLOC_CTX *frame = talloc_stackframe(); - struct loadparm_context *lp_ctx; - NTSTATUS status; - struct samr_Password password; - fstring mach_acct; - struct dcerpc_binding_handle *b = cli->binding_handle; - struct netlogon_creds_CredentialState *creds = NULL; - - if (!ndr_syntax_id_equal(&cli->abstract_syntax, - &ndr_table_netlogon.syntax_id)) { - TALLOC_FREE(frame); - return NT_STATUS_INVALID_PARAMETER; - } - - if (!strequal(lp_netbios_name(), clnt_name)) { - TALLOC_FREE(frame); - return NT_STATUS_INVALID_PARAMETER; - } - - TALLOC_FREE(cli->netlogon_creds); - - fstr_sprintf( mach_acct, "%s$", machine_account); - - lp_ctx = loadparm_init_s3(frame, loadparm_s3_helpers()); - if (lp_ctx == NULL) { - TALLOC_FREE(frame); - return NT_STATUS_NO_MEMORY; - } - status = netlogon_creds_cli_context_global(lp_ctx, - NULL, /* msg_ctx */ - mach_acct, - sec_chan_type, - server_name, - domain, - cli, &cli->netlogon_creds); - talloc_unlink(frame, lp_ctx); - if (!NT_STATUS_IS_OK(status)) { - TALLOC_FREE(frame); - return status; - } - - status = netlogon_creds_cli_get(cli->netlogon_creds, - frame, &creds); - if (NT_STATUS_IS_OK(status)) { - DEBUG(5,("rpccli_netlogon_setup_creds: server %s using " - "cached credential\n", - cli->desthost)); - *neg_flags_inout = creds->negotiate_flags; - TALLOC_FREE(frame); - return NT_STATUS_OK; - } - - /* Store the machine account password we're going to use. */ - memcpy(password.hash, machine_pwd, 16); - - DEBUG(5,("rpccli_netlogon_setup_creds: server %s credential " - "chain established.\n", - cli->desthost )); - - status = netlogon_creds_cli_auth(cli->netlogon_creds, b, - password, NULL); - if (!NT_STATUS_IS_OK(status)) { - TALLOC_FREE(frame); - return status; - } - - status = netlogon_creds_cli_get(cli->netlogon_creds, - frame, &creds); - if (!NT_STATUS_IS_OK(status)) { - TALLOC_FREE(frame); - return NT_STATUS_INTERNAL_ERROR; - } - - *neg_flags_inout = creds->negotiate_flags; - TALLOC_FREE(frame); - return NT_STATUS_OK; -} NTSTATUS rpccli_pre_open_netlogon_creds(void) { diff --git a/source3/rpc_client/cli_netlogon.h b/source3/rpc_client/cli_netlogon.h index 8547db6ede..0de836ad04 100644 --- a/source3/rpc_client/cli_netlogon.h +++ b/source3/rpc_client/cli_netlogon.h @@ -30,14 +30,6 @@ struct dcerpc_binding_handle; /* The following definitions come from rpc_client/cli_netlogon.c */ -NTSTATUS rpccli_netlogon_setup_creds(struct rpc_pipe_client *cli, - const char *server_name, - const char *domain, - const char *clnt_name, - const char *machine_account, - const unsigned char machine_pwd[16], - enum netr_SchannelType sec_chan_type, - uint32_t *neg_flags_inout); NTSTATUS rpccli_pre_open_netlogon_creds(void); NTSTATUS rpccli_create_netlogon_creds(const char *server_computer, const char *server_netbios_domain, -- cgit