[apparmor] [patch 3/5] tests: onexec - check and report signal failure

Tyler Hicks tyhicks at canonical.com
Fri Mar 18 22:16:53 UTC 2016


On 2016-03-18 10:29:07, steve at nxnw.org wrote:
> The onexec test was ignoring errors from the kill() call, so it didn't
> notice when it had unsuccessfully sent SIGSTOP to itself.
> 
> Signed-off-by: Steve Beattie <steve at nxnw.org>

Acked-by: Tyler Hicks <tyhicks at canonical.com>

Thanks!

> ---
>  tests/regression/apparmor/onexec.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> Index: b/tests/regression/apparmor/onexec.c
> ===================================================================
> --- a/tests/regression/apparmor/onexec.c
> +++ b/tests/regression/apparmor/onexec.c
> @@ -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 */
> 
> 
> -- 
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20160318/73a1dd0b/attachment.pgp>


More information about the AppArmor mailing list