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

Diff for /src/usr.bin/passwd/local_passwd.c between version 1.32 and 1.33

version 1.32, 2004/04/20 23:21:23 version 1.33, 2004/07/13 21:09:48
Line 53 
Line 53 
 #define UNCHANGED_MSG   "Password unchanged.\n"  #define UNCHANGED_MSG   "Password unchanged.\n"
   
 static uid_t uid;  static uid_t uid;
 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 *);
   
 char *getnewpasswd(struct passwd *, login_cap_t *, int);  char *getnewpasswd(struct passwd *, login_cap_t *, int);
 void kbintr(int);  void kbintr(int);
Line 172 
Line 172 
                 }                  }
         }          }
   
         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 187 
Line 187 
                 }                  }
   
                 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 195 
Line 195 
                         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, 'l')) {          if (!pwd_gensalt(salt, _PASSWORD_LEN, lc, 'l')) {
                 (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.32  
changed lines
  Added in v.1.33