[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.48 and 1.49

version 1.48, 2016/08/15 04:28:31 version 1.49, 2016/08/31 10:06:41
Line 45 
Line 45 
 #include <util.h>  #include <util.h>
 #include <login_cap.h>  #include <login_cap.h>
   
 #define UNCHANGED_MSG   "Password unchanged.\n"  #define UNCHANGED_MSG   "Password unchanged."
   
 static uid_t uid;  static uid_t uid;
 extern int pwd_check(login_cap_t *, char *);  extern int pwd_check(login_cap_t *, char *);
Line 164 
Line 164 
                 if (uid != 0 && pw->pw_passwd[0] != '\0') {                  if (uid != 0 && pw->pw_passwd[0] != '\0') {
                         p = getpass("Old password:");                          p = getpass("Old password:");
                         if (p == NULL || *p == '\0') {                          if (p == NULL || *p == '\0') {
                                 (void)printf(UNCHANGED_MSG);                                  (void)printf("%s\n", UNCHANGED_MSG);
                                 pw_abort();                                  pw_abort();
                                 exit(p == NULL ? 1 : 0);                                  exit(p == NULL ? 1 : 0);
                         }                          }
Line 180 
Line 180 
         for (buf[0] = '\0', tries = 0;;) {          for (buf[0] = '\0', tries = 0;;) {
                 p = getpass("New password:");                  p = getpass("New password:");
                 if (p == NULL || *p == '\0') {                  if (p == NULL || *p == '\0') {
                         (void)printf(UNCHANGED_MSG);                          (void)printf("%s\n", UNCHANGED_MSG);
                         pw_abort();                          pw_abort();
                         exit(p == NULL ? 1 : 0);                          exit(p == NULL ? 1 : 0);
                 }                  }
Line 211 
Line 211 
         return hash;          return hash;
 }  }
   
 /* ARGSUSED */  
 void  void
 kbintr(int signo)  kbintr(int signo)
 {  {
         write(STDOUT_FILENO, "\n", 1);          dprintf(STDOUT_FILENO, "\n%s\n", UNCHANGED_MSG);
         write(STDOUT_FILENO, UNCHANGED_MSG, sizeof(UNCHANGED_MSG) - 1);  
         _exit(0);          _exit(0);
 }  }

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.49