This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[jra/samba/.git] / source3 / auth / auth_domain.c
index 8c56b4484e4029148331faafcbd46d00a79bcb74..0d90a184a407a5d2095c4a0d034ad4f3ff7a119b 100644 (file)
@@ -115,7 +115,7 @@ static NTSTATUS rpc_resolve_dc(const char *server,
  * @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.
  *
  **/
@@ -212,7 +212,7 @@ machine %s. Error was : %s.\n", remote_machine, cli_errstr(*cli)));
        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);
@@ -274,9 +274,9 @@ static NTSTATUS find_connect_dc(struct cli_state **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 );
 }
@@ -432,7 +432,8 @@ static NTSTATUS check_ntdomain_security(const struct auth_context *auth_context,
 
        /* 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;
                }