4 * NOTE: -P option requires libsemanage, so this feature is
5 * omitted in this version
6 * Yuichi Nakamura <ynakam@hitachisoft.jp>
8 * Licensed under GPLv2, see file LICENSE in this source tree.
10 //config:config SETSEBOOL
11 //config: bool "setsebool (1.7 kb)"
13 //config: depends on SELINUX
15 //config: Enable support for change boolean.
16 //config: semanage and -P option is not supported yet.
18 //applet:IF_SETSEBOOL(APPLET(setsebool, BB_DIR_USR_SBIN, BB_SUID_DROP))
20 //kbuild:lib-$(CONFIG_SETSEBOOL) += setsebool.o
22 //usage:#define setsebool_trivial_usage
23 //usage: "boolean value"
24 //usage:#define setsebool_full_usage "\n\n"
25 //usage: "Change boolean setting"
29 int setsebool_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
30 int setsebool_main(int argc, char **argv)
40 if (LONE_CHAR(p, '1') || strcasecmp(p, "true") == 0 || strcasecmp(p, "on") == 0) {
42 } else if (LONE_CHAR(p, '0') || strcasecmp(p, "false") == 0 || strcasecmp(p, "off") == 0) {
48 if (security_set_boolean(argv[1], value) < 0)
49 bb_error_msg_and_die("can't set boolean");