Add error handling in case exec fails
We should print error message if exec fails, for some reason.
This commit is contained in:
parent
3f9af9deb9
commit
5ac4918bdd
@ -1817,7 +1817,9 @@ static void tallylog_reset (char *user_name)
|
|||||||
pname++; /* Skip the '/' */
|
pname++; /* Skip the '/' */
|
||||||
execl(pam_tally2, pname, "--user", user_name, "--reset", "--quiet", NULL);
|
execl(pam_tally2, pname, "--user", user_name, "--reset", "--quiet", NULL);
|
||||||
/* If we come here, something has gone terribly wrong */
|
/* If we come here, something has gone terribly wrong */
|
||||||
failed = 1;
|
perror(pam_tally2);
|
||||||
|
exit(42); /* don't continue, we now have 2 processes running! */
|
||||||
|
/* NOTREACHED */
|
||||||
break;
|
break;
|
||||||
default: /* parent */
|
default: /* parent */
|
||||||
if (waitpid(childpid, &status, 0) == -1 || !WIFEXITED(status) || WEXITSTATUS(status) != 0)
|
if (waitpid(childpid, &status, 0) == -1 || !WIFEXITED(status) || WEXITSTATUS(status) != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user