=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/passwd/pwd_check.c,v retrieving revision 1.15 retrieving revision 1.16 diff -c -r1.15 -r1.16 *** src/usr.bin/passwd/pwd_check.c 2015/12/09 19:39:10 1.15 --- src/usr.bin/passwd/pwd_check.c 2017/08/21 21:41:13 1.16 *************** *** 1,4 **** ! /* $OpenBSD: pwd_check.c,v 1.15 2015/12/09 19:39:10 mmcc Exp $ */ /* * Copyright 2000 Niels Provos --- 1,4 ---- ! /* $OpenBSD: pwd_check.c,v 1.16 2017/08/21 21:41:13 deraadt Exp $ */ /* * Copyright 2000 Niels Provos *************** *** 138,149 **** err(1, "pledge"); for (i = 0; i < sizeof(patterns) / sizeof(*patterns); i++) { if (regcomp(&rgx, patterns[i].match, patterns[i].flags) != 0) continue; ! res = regexec(&rgx, password, 0, NULL, 0); regfree(&rgx); ! if (res == 0) { printf("%s\n", patterns[i].response); exit(1); } --- 138,151 ---- err(1, "pledge"); for (i = 0; i < sizeof(patterns) / sizeof(*patterns); i++) { + int ret; + if (regcomp(&rgx, patterns[i].match, patterns[i].flags) != 0) continue; ! ret = regexec(&rgx, password, 0, NULL, 0); regfree(&rgx); ! if (ret == 0) { printf("%s\n", patterns[i].response); exit(1); } *************** *** 181,188 **** } /* get the return value from the child */ ! wait(&child); ! if (WIFEXITED(child) && WEXITSTATUS(child) == 0) { free(checker); return (1); } --- 183,193 ---- } /* get the return value from the child */ ! while (waitpid(child, &res, 0) == -1) { ! if (errno != EINTR) ! break; ! } ! if (WIFEXITED(res) && WEXITSTATUS(res) == 0) { free(checker); return (1); }