Skip to contentSkip to conversation

SELinux testsuite compilation fixes

PATCH Superseded Paul Moore 3 participants 6 messages Jun 4, 2015 SELinux security module

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Paul Moore

author
#0 lore raw

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(+)
author
#1 lore raw

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 execnnp
execnnp.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
index a5a80cf..2563909 100644
@@ -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)
 {
author
#2 lore raw

PATCH 2/3 selinux-testsuite: fix compile warnings in tests/setnice

In reply to Paul Moore

Correct the following:

make[2]: Entering directory '/root/sources/selinux-testsuite/tests/setnice'
cc parent.c -lselinux -o parent
parent.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
index d5a2533..6d3c855 100644
@@ -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>
author
#3 lore raw

PATCH 3/3 selinux-testsuite: fix compile warnings in tests/execshare

In reply to Paul Moore

Correct the following:

make[2]: Entering directory '/root/sources/selinux-testsuite/tests/execshare'
cc parent.c -lselinux -o parent
parent.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
index 86f6ae9..343c35f 100644
@@ -1,3 +1,6 @@
+
+#define _GNU_SOURCE
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
Acked-by on v1 3/3
#4 lore raw

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'
cc parent.c -lselinux -o parent
parent.c: In function 'main':
parent.c:83:8: warning: implicit declaration of function 'clone'

  pid = clone(clone_fn, clone_stack, cloneflags | SIGCHLD, argv);
        ^

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
index 86f6ae9..343c35f 100644
@@ -1,3 +1,6 @@
+
+#define _GNU_SOURCE
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
maintainer
#5 lore raw

Re: [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'
cc parent.c -lselinux -o parent
parent.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

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