SELinux testsuite compilation fixes
cover SELinux testsuite compilation fixes
A few compilation fixes found using today's Rawhide.
---
Paul Moore (3):
selinux-testsuite: fix some compile warnings in tests/nnp
selinux-testsuite: fix compile warnings in tests/setnice
selinux-testsuite: fix compile warnings in tests/execshare
tests/execshare/parent.c | 3 +++ tests/nnp/execnnp.c | 5 +++++ tests/setnice/parent.c | 2 ++ 3 files changed, 10 insertions(+)
PATCH 1/3 selinux-testsuite: fix some compile warnings in tests/nnp
Correct the following:
make[2]: Entering directory '/root/sources/selinux-testsuite/tests/nnp'
cc execnnp.c -lselinux -o execnnpexecnnp.c: In function 'main':
execnnp.c:27:9: warning: implicit declaration of function 'strverscmp'
(strverscmp(uts.release, "3.18") < 0));
^execnnp.c:47:8: warning: implicit declaration of function 'wait'
pid = wait(&status);
--- tests/nnp/execnnp.c | 5 +++++ 1 file changed, 5 insertions(+)
tests/nnp/execnnp.c +5 -0
@@ -1,3 +1,6 @@ + +#define _GNU_SOURCE +#include <stdio.h> #include <stdlib.h> #include <string.h>
@@ -5,6 +8,8 @@#include <unistd.h> #include <sys/utsname.h> #include <sys/prctl.h> +#include <sys/types.h> +#include <sys/wait.h> int main (int argc,char **argv) {
PATCH 2/3 selinux-testsuite: fix compile warnings in tests/setnice
In reply to Paul MooreCorrect the following:
make[2]: Entering directory '/root/sources/selinux-testsuite/tests/setnice'
cc parent.c -lselinux -o parentparent.c: In function 'main':
parent.c:92:9: warning: implicit declaration of function 'setpriority'
rc = setpriority(0,pid,10);
^--- tests/setnice/parent.c | 2 ++ 1 file changed, 2 insertions(+)
tests/setnice/parent.c +2 -0
@@ -3,6 +3,8 @@#include <unistd.h> #include <sys/types.h> #include <sys/wait.h> +#include <sys/time.h> +#include <sys/resource.h> #include <signal.h> #include <selinux/selinux.h> #include <selinux/context.h>
PATCH 3/3 selinux-testsuite: fix compile warnings in tests/execshare
In reply to Paul MooreCorrect the following:
make[2]: Entering directory '/root/sources/selinux-testsuite/tests/execshare'
cc parent.c -lselinux -o parentparent.c: In function 'main':
parent.c:83:8: warning: implicit declaration of function 'clone'
pid = clone(clone_fn, clone_stack, cloneflags | SIGCHLD, argv);
^--- tests/execshare/parent.c | 3 +++ 1 file changed, 3 insertions(+)
tests/execshare/parent.c +3 -0
@@ -1,3 +1,6 @@ + +#define _GNU_SOURCE +#include <stdio.h> #include <stdlib.h> #include <unistd.h>
Re: [PATCH 3/3] selinux-testsuite: fix compile warnings in tests/execshare
Quoted 10 lines · Paul Moore
Correct the following:
make[2]: Entering directory '
/root/sources/selinux-testsuite/tests/execshare'
ccparent.c-lselinux -o parentparent.c: In function 'main':
parent.c:83:8: warning: implicit declaration of function 'clone'pid = clone(clone_fn, clone_stack, cloneflags | SIGCHLD, argv); ^Signed-off-by Paul Moore <[email protected]>
Although maybe we should just add -D_GNU_SOURCE to CFLAGS in the tests/Makefile...
Quoted 16 lines
--- tests/execshare/parent.c | 3 +++ 1 file changed, 3 insertions(+)tests/execshare/parent.c +3
-0@@ -1,3 +1,6 @@ + +#define _GNU_SOURCE +#include <stdio.h> #include <stdlib.h> #include <unistd.h>
Paul Moore
maintainerRe: [PATCH 3/3] selinux-testsuite: fix compile warnings in tests/execshare
Quoted 10 lines · Stephen Smalley
Quoted 9 lines · Paul Moore
Correct the following:
make[2]: Entering directory '
/root/sources/selinux-testsuite/tests/execshare'
ccparent.c-lselinux -o parentparent.c: In function 'main':
parent.c:83:8: warning: implicit declaration of function 'clone'pid = clone(clone_fn, clone_stack, cloneflags | SIGCHLD, argv); ^
Quoted 6 lines
Quoted 1 line
Signed-off-by Paul Moore <[email protected]>Acked-by Stephen Smalley <[email protected]>Although maybe we should just add -D_GNU_SOURCE to CFLAGS in the tests/Makefile...
Good point, v2 shortly.
Signature · 2 lines
paul moore www.paul-moore.com