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

Diff for /src/usr.bin/lock/lock.c between version 1.37 and 1.38

version 1.37, 2017/07/08 22:14:48 version 1.38, 2017/07/08 22:19:23
Line 73 
Line 73 
 main(int argc, char *argv[])  main(int argc, char *argv[])
 {  {
         char hostname[HOST_NAME_MAX+1], s[BUFSIZ], s1[BUFSIZ], date[256];          char hostname[HOST_NAME_MAX+1], s[BUFSIZ], s1[BUFSIZ], date[256];
           char hash[_PASSWORD_LEN];
         char *p, *style, *nstyle, *ttynam;          char *p, *style, *nstyle, *ttynam;
         struct itimerval ntimer, otimer;          struct itimerval ntimer, otimer;
         struct timeval timeout;          struct timeval timeout;
Line 160 
Line 161 
                         warnx("\apasswords didn't match.");                          warnx("\apasswords didn't match.");
                         exit(1);                          exit(1);
                 }                  }
                   crypt_newhash(s, "bcrypt", hash, sizeof(hash));
                 explicit_bzero(s, sizeof(s));                  explicit_bzero(s, sizeof(s));
                   explicit_bzero(s1, sizeof(s1));
         }          }
   
         /* set signal handlers */          /* set signal handlers */
Line 209 
Line 212 
                                 explicit_bzero(s, sizeof(s));                                  explicit_bzero(s, sizeof(s));
                                 break;                                  break;
                         }                          }
                 } else if (strcmp(s, s1) == 0) {                  } else if (crypt_checkpass(s, hash) == 0) {
                         explicit_bzero(s, sizeof(s));                          explicit_bzero(s, sizeof(s));
                         explicit_bzero(s1, sizeof(s1));                          explicit_bzero(s1, sizeof(s1));
                         break;                          break;

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38