* @param cli the cli to return containing the active connection
* @param server either a machine name or text IP address to
* connect to.
- * @param trust_password the trust password to establish the
+ * @param trust_passwd the trust password to establish the
* credentials with.
*
**/
result = cli_nt_setup_creds(*cli, sec_chan, trust_passwd, &neg_flags, 2);
if (!NT_STATUS_IS_OK(result)) {
- DEBUG(0,("connect_to_domain_password_server: unable to setup the PDC credentials to machine \
+ DEBUG(0,("connect_to_domain_password_server: unable to setup the NETLOGON credentials to machine \
%s. Error was : %s.\n", remote_machine, nt_errstr(result)));
cli_nt_session_close(*cli);
cli_ulogoff(*cli);
if ( !rpc_find_dc(lp_workgroup(), srv_name, &dc_ip) ) {
DEBUG(0,("find_connect_dc: Failed to find an DCs for %s\n", lp_workgroup()));
- return NT_STATUS_NO_LOGON_SERVERS;
+ return NT_STATUS_NO_LOGON_SERVERS;
}
-
+
return attempt_connect_to_dc( cli, domain, &dc_ip, setup_creds_as,
sec_chan, trust_passwd );
}
/* Test if machine password has expired and needs to be changed */
if (lp_machine_password_timeout()) {
- if (time(NULL) > (last_change_time +
+ if (last_change_time > 0 &&
+ time(NULL) > (last_change_time +
lp_machine_password_timeout())) {
global_machine_password_needs_changing = True;
}