2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-30 05:47:59 +00:00

tests: onexec - check and report signal failure

The onexec test was ignoring errors from the kill() call, so it didn't
notice when it had failed to send SIGSTOP to itself.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Tyler Hicks <tyhicks@canonical.com>
This commit is contained in:
Steve Beattie 2016-03-19 01:35:42 -07:00
parent b6e42015a6
commit 0e2bbc98b8

View File

@ -45,7 +45,12 @@ int main(int argc, char *argv[])
/* stop after onexec and wait to for continue before exec so
* caller can introspect task */
(void)kill(getpid(), SIGSTOP);
rc = kill(getpid(), SIGSTOP);
if (rc == -1){
fprintf(stderr, "FAIL: signal to self failed - %s\n",
strerror(errno));
exit(errno);
}
(void)execve(argv[2], &argv[2], environ);
/* exec failed, kill outselves to flag parent */