#include "busybox.h"
+int getenforce_main(int argc, char **argv);
int getenforce_main(int argc, char **argv)
{
int rc;
#include "busybox.h"
+int getsebool_main(int argc, char **argv);
int getsebool_main(int argc, char **argv)
{
int i, rc = 0, active, pending, len = 0;
#define OPT_PREFIX (1<<3) /* -p */
#define OPT_VERIFY (1<<4) /* -V */
+int matchpathcon_main(int argc, char **argv);
int matchpathcon_main(int argc, char **argv)
{
int error = 0;
argv += optind;
if (opts & OPT_NOT_TRANS) {
- set_matchpathcon_flags(NOTRANS);
+ set_matchpathcon_flags(MATCHPATHCON_NOTRANS);
}
if (opts & OPT_FCONTEXT) {
if (matchpathcon_init(fcontext))
int rc;
if (!(opts & OPT_VERIFY)) {
- error += print_matchpathcon(path, opt & OPT_NOT_PRINT);
+ error += print_matchpathcon(path, opts & OPT_NOT_PRINT);
continue;
}
*/
#include "busybox.h"
+int selinuxenabled_main(int argc, char **argv);
int selinuxenabled_main(int argc, char **argv)
{
return !is_selinux_enabled();
#include "busybox.h"
-static const smallint setenforce_mode[] = {
- 0,
- 1,
- 0,
- 1,
-};
+/* These strings are arranged so that odd ones
+ * result in security_setenforce(1) being done,
+ * the rest will do security_setenforce(0) */
static const char *const setenforce_cmd[] = {
"0",
"1",
NULL,
};
+int setenforce_main(int argc, char **argv);
int setenforce_main(int argc, char **argv)
{
int i, rc;
for (i = 0; setenforce_cmd[i]; i++) {
if (strcasecmp(argv[1], setenforce_cmd[i]) != 0)
continue;
- rc = security_setenforce(setenforce_mode[i]);
+ rc = security_setenforce(i & 1);
if (rc < 0)
bb_perror_msg_and_die("setenforce() failed");
return 0;