[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.24.2.3 and 1.25

version 1.24.2.3, 2002/06/26 15:30:37 version 1.25, 2002/05/06 23:00:59
Line 54 
Line 54 
 auth_password(Authctxt *authctxt, const char *password)  auth_password(Authctxt *authctxt, const char *password)
 {  {
         struct passwd * pw = authctxt->pw;          struct passwd * pw = authctxt->pw;
           char *encrypted_password;
   
         /* deny if no user. */          /* deny if no user. */
         if (pw == NULL)          if (pw == NULL)
                 return 0;                  return 0;
         if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)          if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
                 return 0;                  return 0;
         if (*password == '\0' && options.permit_empty_passwd == 0)          if (*pw->pw_passwd == '\0' && options.permit_empty_passwd == 0)
                 return 0;                  return 0;
 #ifdef KRB5  #ifdef KRB5
         if (options.kerberos_authentication == 1) {          if (options.kerberos_authentication == 1) {
Line 84 
Line 85 
                 return 0;                  return 0;
         else          else
                 return 1;                  return 1;
 #else  #endif
         /* Check for users with no password. */          /* Check for users with no password. */
         if (strcmp(password, "") == 0 && strcmp(pw->pw_passwd, "") == 0)          if (strcmp(password, "") == 0 && strcmp(pw->pw_passwd, "") == 0)
                 return 1;                  return 1;
         else {          /* Encrypt the candidate password using the proper salt. */
                 /* Encrypt the candidate password using the proper salt. */          encrypted_password = crypt(password,
                 char *encrypted_password = crypt(password,              (pw->pw_passwd[0] && pw->pw_passwd[1]) ? pw->pw_passwd : "xx");
                     (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);
                  * Authentication is accepted if the encrypted passwords  
                  * are identical.  
                  */  
                 return (strcmp(encrypted_password, pw->pw_passwd) == 0);  
         }  
 #endif  
 }  }

Legend:
Removed from v.1.24.2.3  
changed lines
  Added in v.1.25