From: Pádraig Brady
Date: Tue, 22 Sep 2015 18:07:41 +0000 (+0100)
Subject: maint: avoid deprecation warning with
X-Git-Tag: v8.25~143
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50e61bfdb9d2df30e1db97ae4ebec7044e087d29;p=thirdparty%2Fcoreutils.git
maint: avoid deprecation warning with
* src/runcon.c (main): As per the compile time warning from
libselinux-2.4-3, lookup the class with string_to_security_class(),
rather than using defines from flask.h.
---
diff --git a/src/runcon.c b/src/runcon.c
index 5b9cb33409..33250308da 100644
--- a/src/runcon.c
+++ b/src/runcon.c
@@ -45,11 +45,6 @@
#include
#include
#include
-#ifdef HAVE_SELINUX_FLASK_H
-# include
-#else
-# define SECCLASS_PROCESS 0
-#endif
#include
#include "system.h"
#include "error.h"
@@ -222,7 +217,8 @@ main (int argc, char **argv)
quote (argv[optind]));
/* compute result of process transition */
if (security_compute_create (cur_context, file_context,
- SECCLASS_PROCESS, &new_context) != 0)
+ string_to_security_class ("process"),
+ &new_context) != 0)
error (EXIT_FAILURE, errno, _("failed to compute a new context"));
/* free contexts */
freecon (file_context);