[PATCH testsuite 4/4] tests: stop using deprecated security_context_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In Travis CI, GCC reports in several places:

gcc -g -O0 -Wall -D_GNU_SOURCE -DHAVE_BPF    parent.c  -lselinux -o parent
parent.c: In function ‘main’:
parent.c:25:2: warning: ‘security_context_t’ is deprecated [-Wdeprecated-declarations]
  security_context_t context_s;
  ^~~~~~~~~~~~~~~~~~

Fix this by using plain char * instead of security_context_t.

Signed-off-by: Ondrej Mosnacek <omosnace@xxxxxxxxxx>
---
 tests/bounds/thread.c    | 4 ++--
 tests/dyntrace/parent.c  | 2 +-
 tests/dyntrans/parent.c  | 2 +-
 tests/execshare/parent.c | 2 +-
 tests/exectrace/parent.c | 2 +-
 tests/inherit/parent.c   | 2 +-
 tests/prlimit/parent.c   | 2 +-
 tests/setnice/parent.c   | 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tests/bounds/thread.c b/tests/bounds/thread.c
index d09a634..acb976f 100644
--- a/tests/bounds/thread.c
+++ b/tests/bounds/thread.c
@@ -19,7 +19,7 @@ static int thread_status = 0;
 
 static void *worker(void *datap)
 {
-	security_context_t security_context = datap;
+	char *security_context = datap;
 	int rc;
 
 	rc = setcon(security_context);
@@ -31,7 +31,7 @@ static void *worker(void *datap)
 
 int main(int argc, char *argv[])
 {
-	security_context_t security_context;
+	char *security_context;
 	context_t context;
 	pthread_t thread;
 	int rc;
diff --git a/tests/dyntrace/parent.c b/tests/dyntrace/parent.c
index a3a644e..63cbd76 100644
--- a/tests/dyntrace/parent.c
+++ b/tests/dyntrace/parent.c
@@ -12,7 +12,7 @@
 int main(int argc, char **argv)
 {
 	int pid, rc, status;
-	security_context_t context_s;
+	char *context_s;
 	context_t context;
 	char *child_argv[3];
 
diff --git a/tests/dyntrans/parent.c b/tests/dyntrans/parent.c
index 660a1d5..c8320cc 100644
--- a/tests/dyntrans/parent.c
+++ b/tests/dyntrans/parent.c
@@ -11,7 +11,7 @@
 int main(int argc, char **argv)
 {
 	int rc;
-	security_context_t context_s;
+	char *context_s;
 	context_t context;
 
 	if (argc != 2) {
diff --git a/tests/execshare/parent.c b/tests/execshare/parent.c
index 2357265..5b9bd80 100644
--- a/tests/execshare/parent.c
+++ b/tests/execshare/parent.c
@@ -22,7 +22,7 @@ int main(int argc, char **argv)
 	int pagesize;
 	void *clone_stack, *page;
 	int pid, rc, status, cloneflags;
-	security_context_t context_s;
+	char *context_s;
 	context_t context;
 
 	if (argc != 4) {
diff --git a/tests/exectrace/parent.c b/tests/exectrace/parent.c
index 88adb56..6906ee9 100644
--- a/tests/exectrace/parent.c
+++ b/tests/exectrace/parent.c
@@ -11,7 +11,7 @@
 int main(int argc, char **argv)
 {
 	int pid, rc, status;
-	security_context_t context_s;
+	char *context_s;
 	context_t context;
 
 	if (argc != 3) {
diff --git a/tests/inherit/parent.c b/tests/inherit/parent.c
index be48b79..10b59b4 100644
--- a/tests/inherit/parent.c
+++ b/tests/inherit/parent.c
@@ -9,7 +9,7 @@
 int main(int argc, char **argv)
 {
 	char **childargv;
-	security_context_t context_s;
+	char *context_s;
 	context_t context;
 	int rc, fd;
 
diff --git a/tests/prlimit/parent.c b/tests/prlimit/parent.c
index 11c0c25..b735445 100644
--- a/tests/prlimit/parent.c
+++ b/tests/prlimit/parent.c
@@ -26,7 +26,7 @@ int main(int argc, char **argv)
 {
 	char buf[1];
 	int pid, rc, fd[2], fd2[2], opt;
-	security_context_t context_s;
+	char *context_s;
 	context_t context;
 	struct rlimit newrlim, oldrlim, *newrlimp = NULL, *oldrlimp = NULL;
 	bool get = false, set = false, soft = false;
diff --git a/tests/setnice/parent.c b/tests/setnice/parent.c
index b010aa0..bbb0c7f 100644
--- a/tests/setnice/parent.c
+++ b/tests/setnice/parent.c
@@ -14,7 +14,7 @@ int main(int argc, char **argv)
 {
 	char buf[1];
 	int pid, rc, rc2, fd[2], fd2[2];
-	security_context_t context_s;
+	char *context_s;
 	context_t context;
 
 	if (argc != 3) {
-- 
2.26.2




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux