4 * Based on libselinux 1.33.1
5 * Port to BusyBox Hiroshi Shinji <shiroshi@my.email.ne.jp>
7 * Licensed under GPLv2, see file LICENSE in this tarball for details.
12 int getsebool_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
13 int getsebool_main(int argc, char **argv)
15 int i, rc = 0, active, pending, len = 0;
20 opt = getopt32(argv, "a");
26 rc = security_get_boolean_names(&names, &len);
28 bb_perror_msg_and_die("cannot get boolean names");
40 names = xmalloc(sizeof(char *) * len);
41 for (i = 0; i < len; i++)
42 names[i] = xstrdup(argv[i + 1]);
45 for (i = 0; i < len; i++) {
46 active = security_get_boolean_active(names[i]);
48 bb_error_msg_and_die("error getting active value for %s", names[i]);
50 pending = security_get_boolean_pending(names[i]);
52 bb_error_msg_and_die("error getting pending value for %s", names[i]);
54 printf("%s --> %s", names[i], (active ? "on" : "off"));
55 if (pending != active)
56 printf(" pending: %s", (pending ? "on" : "off"));
60 if (ENABLE_FEATURE_CLEAN_UP) {
61 for (i = 0; i < len; i++)