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

Diff for /src/usr.bin/passwd/Attic/yp_passwd.c between version 1.27 and 1.28

version 1.27, 2004/03/12 22:59:28 version 1.28, 2004/07/13 21:09:48
Line 57 
Line 57 
 #define _PASSWORD_LEN PASS_MAX  #define _PASSWORD_LEN PASS_MAX
 #endif  #endif
   
 extern int      pwd_gensalt(char *, int, struct passwd *, login_cap_t *, char);  extern int      pwd_gensalt(char *, int, login_cap_t *, char);
 extern int      pwd_check(struct passwd *, login_cap_t *, char *);  extern int      pwd_check(login_cap_t *, char *);
 extern int      pwd_gettries(struct passwd *, login_cap_t *);  extern int      pwd_gettries(login_cap_t *);
 extern void     kbintr(int);  extern void     kbintr(int);
   
 char            *ypgetnewpasswd(struct passwd *, login_cap_t *, char **);  char            *ypgetnewpasswd(struct passwd *, login_cap_t *, char **);
Line 215 
Line 215 
                         pw_error(NULL, 1, 1);                          pw_error(NULL, 1, 1);
         }          }
   
         pwd_tries = pwd_gettries(pw, lc);          pwd_tries = pwd_gettries(lc);
   
         for (buf[0] = '\0', tries = 0;;) {          for (buf[0] = '\0', tries = 0;;) {
                 p = getpass("New password:");                  p = getpass("New password:");
Line 227 
Line 227 
                         continue;                          continue;
                 }                  }
                 if ((tries++ < pwd_tries || pwd_tries == 0)                  if ((tries++ < pwd_tries || pwd_tries == 0)
                     && pwd_check(pw, lc, p) == 0)                      && pwd_check(lc, p) == 0)
                         continue;                          continue;
                 strlcpy(buf, p, sizeof buf);                  strlcpy(buf, p, sizeof buf);
                 p = getpass("Retype new password:");                  p = getpass("Retype new password:");
Line 235 
Line 235 
                         break;                          break;
                 (void)printf("Mismatch; try again, EOF to quit.\n");                  (void)printf("Mismatch; try again, EOF to quit.\n");
         }          }
         if (!pwd_gensalt(salt, _PASSWORD_LEN, pw, lc, 'y')) {          if (!pwd_gensalt(salt, _PASSWORD_LEN, lc, 'y')) {
                 (void)printf("Couldn't generate salt.\n");                  (void)printf("Couldn't generate salt.\n");
                 pw_error(NULL, 0, 0);                  pw_error(NULL, 0, 0);
         }          }

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28