2007-02-06 19:28:50 +00:00
|
|
|
/*
|
|
|
|
* selinuxenabled
|
2007-03-07 09:35:43 +00:00
|
|
|
*
|
2007-02-06 19:28:50 +00:00
|
|
|
* Based on libselinux 1.33.1
|
|
|
|
* Port to BusyBox Hiroshi Shinji <shiroshi@my.email.ne.jp>
|
|
|
|
*
|
2010-08-16 20:14:46 +02:00
|
|
|
* Licensed under GPLv2, see file LICENSE in this source tree.
|
2007-02-06 19:28:50 +00:00
|
|
|
*/
|
2016-11-23 18:46:40 +01:00
|
|
|
//config:config SELINUXENABLED
|
2017-07-19 14:32:54 +02:00
|
|
|
//config: bool "selinuxenabled (321 bytes)"
|
2016-11-23 18:46:40 +01:00
|
|
|
//config: default n
|
|
|
|
//config: depends on SELINUX
|
|
|
|
//config: help
|
2017-07-21 09:50:55 +02:00
|
|
|
//config: Enable support for this command to be used within shell scripts
|
|
|
|
//config: to determine if selinux is enabled.
|
2016-11-23 18:46:40 +01:00
|
|
|
|
|
|
|
//applet:IF_SELINUXENABLED(APPLET(selinuxenabled, BB_DIR_USR_SBIN, BB_SUID_DROP))
|
|
|
|
|
|
|
|
//kbuild:lib-$(CONFIG_SELINUXENABLED) += selinuxenabled.o
|
2011-04-11 03:29:49 +02:00
|
|
|
|
|
|
|
//usage:#define selinuxenabled_trivial_usage NOUSAGE_STR
|
|
|
|
//usage:#define selinuxenabled_full_usage ""
|
|
|
|
|
2007-05-26 19:00:18 +00:00
|
|
|
#include "libbb.h"
|
2007-02-06 19:28:50 +00:00
|
|
|
|
2007-10-11 10:05:36 +00:00
|
|
|
int selinuxenabled_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
2008-07-05 09:18:54 +00:00
|
|
|
int selinuxenabled_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
|
2007-02-06 19:28:50 +00:00
|
|
|
{
|
|
|
|
return !is_selinux_enabled();
|
|
|
|
}
|