blob: b80c4e71b39f6fcc15b28f4b615c8dd4c59b1244 [file] [log] [blame]
Denis Vlasenkod46d3c22007-02-06 19:28:50 +00001/*
2 * selinuxenabled
Denis Vlasenko8e858e22007-03-07 09:35:43 +00003 *
Denis Vlasenkod46d3c22007-02-06 19:28:50 +00004 * Based on libselinux 1.33.1
5 * Port to BusyBox Hiroshi Shinji <shiroshi@my.email.ne.jp>
6 *
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02007 * Licensed under GPLv2, see file LICENSE in this source tree.
Denis Vlasenkod46d3c22007-02-06 19:28:50 +00008 */
Denys Vlasenkoa8e52da2016-11-23 18:46:40 +01009//config:config SELINUXENABLED
10//config: bool "selinuxenabled"
11//config: default n
12//config: depends on SELINUX
13//config: help
14//config: Enable support for this command to be used within shell scripts
15//config: to determine if selinux is enabled.
16
17//applet:IF_SELINUXENABLED(APPLET(selinuxenabled, BB_DIR_USR_SBIN, BB_SUID_DROP))
18
19//kbuild:lib-$(CONFIG_SELINUXENABLED) += selinuxenabled.o
Pere Orga5bc8c002011-04-11 03:29:49 +020020
21//usage:#define selinuxenabled_trivial_usage NOUSAGE_STR
22//usage:#define selinuxenabled_full_usage ""
23
Denis Vlasenkob6adbf12007-05-26 19:00:18 +000024#include "libbb.h"
Denis Vlasenkod46d3c22007-02-06 19:28:50 +000025
Denis Vlasenko9b49a5e2007-10-11 10:05:36 +000026int selinuxenabled_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
Denis Vlasenkoa60f84e2008-07-05 09:18:54 +000027int selinuxenabled_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
Denis Vlasenkod46d3c22007-02-06 19:28:50 +000028{
29 return !is_selinux_enabled();
30}