summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2015-09-22 19:07:41 +0100
committerPádraig Brady <P@draigBrady.com>2015-09-22 19:09:32 +0100
commit50e61bfdb9d2df30e1db97ae4ebec7044e087d29 (patch)
tree9ac667a753a099eacf1ce96e9e1846b18cd1987a /src
parentdee6b7601009688cfb931379b47a701f7dd771e3 (diff)
downloadcoreutils-50e61bfdb9d2df30e1db97ae4ebec7044e087d29.tar.xz
maint: avoid deprecation warning with <selinux/flask.h>
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/runcon.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/runcon.c b/src/runcon.c
index 5b9cb3340..33250308d 100644
--- a/src/runcon.c
+++ b/src/runcon.c
@@ -45,11 +45,6 @@
#include <getopt.h>
#include <selinux/selinux.h>
#include <selinux/context.h>
-#ifdef HAVE_SELINUX_FLASK_H
-# include <selinux/flask.h>
-#else
-# define SECCLASS_PROCESS 0
-#endif
#include <sys/types.h>
#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);