s3:rpc_client: remove unused rpccli_netlogon_setup_creds()
authorStefan Metzmacher <metze@samba.org>
Fri, 6 Sep 2013 11:06:53 +0000 (13:06 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 7 Jan 2014 11:47:15 +0000 (12:47 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/rpc_client/cli_netlogon.c
source3/rpc_client/cli_netlogon.h

index 2f23d1b8ea847770a1dec6dc2882dc8654ac1d43..687d0c208245140fb0975645e1047560b9678ee9 100644 (file)
 #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)
 {
index 8547db6edefcd95948f659c9480586e028ddf03c..0de836ad04994020243b2683f3284a601bb1f57b 100644 (file)
@@ -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,