summaryrefslogtreecommitdiff
path: root/src/chcon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/chcon.c')
-rw-r--r--src/chcon.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/chcon.c b/src/chcon.c
index fbfdb4d29..c0da6949a 100644
--- a/src/chcon.c
+++ b/src/chcon.c
@@ -519,6 +519,10 @@ main (int argc, char **argv)
usage (EXIT_FAILURE);
}
+ if (is_selinux_enabled () != 1)
+ error (EXIT_FAILURE, 0,
+ _("%s may be used only on a SELinux kernel"), program_name);
+
if (reference_file)
{
if (getfilecon (reference_file, &ref_context) < 0)