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

Diff for /src/usr.bin/passwd/pwd_check.c between version 1.15 and 1.16

version 1.15, 2015/12/09 19:39:10 version 1.16, 2017/08/21 21:41:13
Line 138 
Line 138 
                                 err(1, "pledge");                                  err(1, "pledge");
   
                         for (i = 0; i < sizeof(patterns) / sizeof(*patterns); i++) {                          for (i = 0; i < sizeof(patterns) / sizeof(*patterns); i++) {
                                   int ret;
   
                                 if (regcomp(&rgx, patterns[i].match,                                  if (regcomp(&rgx, patterns[i].match,
                                     patterns[i].flags) != 0)                                      patterns[i].flags) != 0)
                                         continue;                                          continue;
                                 res = regexec(&rgx, password, 0, NULL, 0);                                  ret = regexec(&rgx, password, 0, NULL, 0);
                                 regfree(&rgx);                                  regfree(&rgx);
                                 if (res == 0) {                                  if (ret == 0) {
                                         printf("%s\n", patterns[i].response);                                          printf("%s\n", patterns[i].response);
                                         exit(1);                                          exit(1);
                                 }                                  }
Line 181 
Line 183 
         }          }
   
         /* get the return value from the child */          /* get the return value from the child */
         wait(&child);          while (waitpid(child, &res, 0) == -1) {
         if (WIFEXITED(child) && WEXITSTATUS(child) == 0) {                  if (errno != EINTR)
                           break;
           }
           if (WIFEXITED(res) && WEXITSTATUS(res) == 0) {
                 free(checker);                  free(checker);
                 return (1);                  return (1);
         }          }

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16