Changeset 165 for branches/samba-3.0/source/libsmb/trusts_util.c
- Timestamp:
- Mar 11, 2009, 9:14:55 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/source/libsmb/trusts_util.c
r134 r165 33 33 static NTSTATUS just_change_the_password(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, 34 34 const unsigned char orig_trust_passwd_hash[16], 35 const char *new_trust_pwd_cleartext, 35 36 const unsigned char new_trust_passwd_hash[16], 36 37 uint32 sec_channel_type) 37 38 { 38 39 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, 47 43 cli->cli->desthost, /* server name */ 48 44 lp_workgroup(), /* domain */ … … 53 49 &neg_flags); 54 50 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 } 63 64 64 65 if (!NT_STATUS_IS_OK(result)) { … … 96 97 97 98 nt_status = just_change_the_password(cli, mem_ctx, orig_trust_passwd_hash, 99 new_trust_passwd, 98 100 new_trust_passwd_hash, sec_channel_type); 99 101
Note:
See TracChangeset
for help on using the changeset viewer.