[BACK]Return to auth-passwd.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/auth-passwd.c between version 1.42 and 1.43

version 1.42, 2007/08/23 02:55:51 version 1.43, 2007/09/21 08:15:29
Line 95 
Line 95 
         return (sys_auth_passwd(authctxt, password) && ok);          return (sys_auth_passwd(authctxt, password) && ok);
 }  }
   
 #ifdef BSD_AUTH  
 static void  static void
 warn_expiry(Authctxt *authctxt, auth_session_t *as)  warn_expiry(Authctxt *authctxt, auth_session_t *as)
 {  {
Line 152 
Line 151 
                 return (auth_close(as));                  return (auth_close(as));
         }          }
 }  }
 #else  
 int  
 sys_auth_passwd(Authctxt *authctxt, const char *password)  
 {  
         struct passwd *pw = authctxt->pw;  
         char *encrypted_password;  
   
         /* Check for users with no password. */  
         if (strcmp(password, "") == 0 && strcmp(pw->pw_passwd, "") == 0)  
                 return (1);  
   
         /* Encrypt the candidate password using the proper salt. */  
         encrypted_password = crypt(password,  
             (pw->pw_passwd[0] && pw->pw_passwd[1]) ?  
             pw->pw_passwd : "xx");  
   
         /*  
          * Authentication is accepted if the encrypted passwords  
          * are identical.  
          */  
         return (strcmp(encrypted_password, pw->pw_passwd) == 0);  
 }  
 #endif  

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43