Ignore:
Timestamp:
Mar 11, 2009, 9:14:55 AM (16 years ago)
Author:
Paul Smedley
Message:

Add 'missing' 3.0.34 diffs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/libsmb/trusts_util.c

    r134 r165  
    3333static NTSTATUS just_change_the_password(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
    3434                                         const unsigned char orig_trust_passwd_hash[16],
     35                                         const char *new_trust_pwd_cleartext,
    3536                                         const unsigned char new_trust_passwd_hash[16],
    3637                                         uint32 sec_channel_type)
    3738{
    3839        NTSTATUS result;
    39 
    40         /* Check if the netlogon pipe is open using schannel. If so we
    41            already have valid creds. If not we must set them up. */
    42 
    43         if (cli->auth.auth_type != PIPE_AUTH_TYPE_SCHANNEL) {
    44                 uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
    45 
    46                 result = rpccli_netlogon_setup_creds(cli,
     40        uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
     41
     42        result = rpccli_netlogon_setup_creds(cli,
    4743                                        cli->cli->desthost, /* server name */
    4844                                        lp_workgroup(), /* domain */
     
    5349                                        &neg_flags);
    5450
    55                 if (!NT_STATUS_IS_OK(result)) {
    56                         DEBUG(3,("just_change_the_password: unable to setup creds (%s)!\n",
    57                                  nt_errstr(result)));
    58                         return result;
    59                 }
    60         }
    61 
    62         result = rpccli_net_srv_pwset(cli, mem_ctx, global_myname(), new_trust_passwd_hash);
     51        if (!NT_STATUS_IS_OK(result)) {
     52                DEBUG(3,("just_change_the_password: unable to setup creds (%s)!\n",
     53                         nt_errstr(result)));
     54                return result;
     55        }
     56
     57        if (neg_flags & NETLOGON_NEG_PASSWORD_SET2) {
     58                result = rpccli_net_srv_pwset2(cli, mem_ctx, global_myname(),
     59                                               new_trust_pwd_cleartext);
     60        } else {
     61                result = rpccli_net_srv_pwset(cli, mem_ctx, global_myname(),
     62                                              new_trust_passwd_hash);
     63        }
    6364
    6465        if (!NT_STATUS_IS_OK(result)) {
     
    9697
    9798        nt_status = just_change_the_password(cli, mem_ctx, orig_trust_passwd_hash,
     99                                             new_trust_passwd,
    98100                                             new_trust_passwd_hash, sec_channel_type);
    99101       
Note: See TracChangeset for help on using the changeset viewer.