Denis Vlasenko | d46d3c2 | 2007-02-06 19:28:50 +0000 | [diff] [blame] | 1 | /* |
| 2 | * selinuxenabled |
Denis Vlasenko | 8e858e2 | 2007-03-07 09:35:43 +0000 | [diff] [blame] | 3 | * |
Denis Vlasenko | d46d3c2 | 2007-02-06 19:28:50 +0000 | [diff] [blame] | 4 | * Based on libselinux 1.33.1 |
| 5 | * Port to BusyBox Hiroshi Shinji <shiroshi@my.email.ne.jp> |
| 6 | * |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 7 | * Licensed under GPLv2, see file LICENSE in this source tree. |
Denis Vlasenko | d46d3c2 | 2007-02-06 19:28:50 +0000 | [diff] [blame] | 8 | */ |
Denys Vlasenko | a8e52da | 2016-11-23 18:46:40 +0100 | [diff] [blame] | 9 | //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 Orga | 5bc8c00 | 2011-04-11 03:29:49 +0200 | [diff] [blame] | 20 | |
| 21 | //usage:#define selinuxenabled_trivial_usage NOUSAGE_STR |
| 22 | //usage:#define selinuxenabled_full_usage "" |
| 23 | |
Denis Vlasenko | b6adbf1 | 2007-05-26 19:00:18 +0000 | [diff] [blame] | 24 | #include "libbb.h" |
Denis Vlasenko | d46d3c2 | 2007-02-06 19:28:50 +0000 | [diff] [blame] | 25 | |
Denis Vlasenko | 9b49a5e | 2007-10-11 10:05:36 +0000 | [diff] [blame] | 26 | int selinuxenabled_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
Denis Vlasenko | a60f84e | 2008-07-05 09:18:54 +0000 | [diff] [blame] | 27 | int selinuxenabled_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) |
Denis Vlasenko | d46d3c2 | 2007-02-06 19:28:50 +0000 | [diff] [blame] | 28 | { |
| 29 | return !is_selinux_enabled(); |
| 30 | } |