diff options
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_netlogon.c | 34 | ||||
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 7 | ||||
-rw-r--r-- | source3/rpc_client/cli_reg.c | 62 | ||||
-rw-r--r-- | source3/rpc_client/cli_samr.c | 2 |
4 files changed, 20 insertions, 85 deletions
diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c index 911a50f393..191a0b0126 100644 --- a/source3/rpc_client/cli_netlogon.c +++ b/source3/rpc_client/cli_netlogon.c @@ -509,33 +509,35 @@ NTSTATUS rpccli_netlogon_sam_network_logon_ex(struct rpc_pipe_client *cli, NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *account_name, const unsigned char orig_trust_passwd_hash[16], const char *new_trust_pwd_cleartext, const unsigned char new_trust_passwd_hash[16], - uint32_t sec_channel_type) + enum netr_SchannelType sec_channel_type) { NTSTATUS result; - uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS; struct netr_Authenticator clnt_creds, srv_cred; - result = rpccli_netlogon_setup_creds(cli, - cli->desthost, /* server name */ - lp_workgroup(), /* domain */ - global_myname(), /* client name */ - global_myname(), /* machine account name */ - orig_trust_passwd_hash, - sec_channel_type, - &neg_flags); - - if (!NT_STATUS_IS_OK(result)) { - DEBUG(3,("rpccli_netlogon_set_trust_password: unable to setup creds (%s)!\n", - nt_errstr(result))); - return result; + if (!cli->dc) { + uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS; + result = rpccli_netlogon_setup_creds(cli, + cli->desthost, /* server name */ + lp_workgroup(), /* domain */ + global_myname(), /* client name */ + account_name, /* machine account name */ + orig_trust_passwd_hash, + sec_channel_type, + &neg_flags); + if (!NT_STATUS_IS_OK(result)) { + DEBUG(3,("rpccli_netlogon_set_trust_password: unable to setup creds (%s)!\n", + nt_errstr(result))); + return result; + } } netlogon_creds_client_authenticator(cli->dc, &clnt_creds); - if (neg_flags & NETLOGON_NEG_PASSWORD_SET2) { + if (cli->dc->negotiate_flags & NETLOGON_NEG_PASSWORD_SET2) { struct netr_CryptPassword new_password; diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 34b8616907..c197bd4929 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -3819,7 +3819,7 @@ static NTSTATUS get_schannel_session_key_common(struct rpc_pipe_client *netlogon const char *domain, uint32 *pneg_flags) { - uint32 sec_chan_type = 0; + enum netr_SchannelType sec_chan_type = 0; unsigned char machine_pwd[16]; const char *machine_account; NTSTATUS status; @@ -3940,11 +3940,6 @@ NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli, * in - reference them in */ result->dc = talloc_move(result, pdc); - if (result->dc == NULL) { - DEBUG(0, ("talloc reference failed\n")); - TALLOC_FREE(result); - return NT_STATUS_NO_MEMORY; - } DEBUG(10,("cli_rpc_pipe_open_schannel_with_key: opened pipe %s to machine %s " "for domain %s and bound using schannel.\n", diff --git a/source3/rpc_client/cli_reg.c b/source3/rpc_client/cli_reg.c deleted file mode 100644 index ec200a24ae..0000000000 --- a/source3/rpc_client/cli_reg.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - Unix SMB/CIFS implementation. - RPC Pipe client - - Copyright (C) Gerald (Jerry) Carter 2005-2006 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include "includes.h" -#include "rpc_client.h" - -/******************************************************************* - connect to a registry hive root (open a registry policy) -*******************************************************************/ - -NTSTATUS rpccli_winreg_Connect(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - uint32 reg_type, uint32 access_mask, - struct policy_handle *reg_hnd) -{ - ZERO_STRUCTP(reg_hnd); - - switch (reg_type) - { - case HKEY_CLASSES_ROOT: - return rpccli_winreg_OpenHKCR( cli, mem_ctx, NULL, - access_mask, reg_hnd, NULL); - - case HKEY_LOCAL_MACHINE: - return rpccli_winreg_OpenHKLM( cli, mem_ctx, NULL, - access_mask, reg_hnd, NULL); - - case HKEY_USERS: - return rpccli_winreg_OpenHKU( cli, mem_ctx, NULL, - access_mask, reg_hnd, NULL); - - case HKEY_CURRENT_USER: - return rpccli_winreg_OpenHKCU( cli, mem_ctx, NULL, - access_mask, reg_hnd, NULL); - - case HKEY_PERFORMANCE_DATA: - return rpccli_winreg_OpenHKPD( cli, mem_ctx, NULL, - access_mask, reg_hnd, NULL); - - default: - /* fall through to end of function */ - break; - } - - return NT_STATUS_INVALID_PARAMETER; -} diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c index 5a0dff2965..df22ecb284 100644 --- a/source3/rpc_client/cli_samr.c +++ b/source3/rpc_client/cli_samr.c @@ -187,7 +187,7 @@ NTSTATUS rpccli_samr_chgpasswd_user3(struct rpc_pipe_client *cli, const char *newpassword, const char *oldpassword, struct samr_DomInfo1 **dominfo1, - struct samr_ChangeReject **reject) + struct userPwdChangeFailureInformation **reject) { NTSTATUS status; |