4 * Based on libselinux 1.33.1
5 * Port to BusyBox Hiroshi Shinji <shiroshi@my.email.ne.jp>
11 int getsebool_main(int argc, char **argv);
12 int getsebool_main(int argc, char **argv)
14 int i, rc = 0, active, pending, len = 0;
19 opt = getopt32(argc, argv, "a");
25 rc = security_get_boolean_names(&names, &len);
27 bb_perror_msg_and_die("cannot get boolean names");
39 names = xmalloc(sizeof(char *) * len);
40 for (i = 0; i < len; i++)
41 names[i] = xstrdup(argv[i + 1]);
44 for (i = 0; i < len; i++) {
45 active = security_get_boolean_active(names[i]);
47 bb_error_msg_and_die("error getting active value for %s", names[i]);
49 pending = security_get_boolean_pending(names[i]);
51 bb_error_msg_and_die("error getting pending value for %s", names[i]);
53 printf("%s --> %s", names[i], (active ? "on" : "off"));
54 if (pending != active)
55 printf(" pending: %s", (pending ? "on" : "off"));
59 if (ENABLE_FEATURE_CLEAN_UP) {
60 for (i = 0; i < len; i++)