aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-03-27 21:52:24 -0500
committerRob Landley <rob@landley.net>2015-03-27 21:52:24 -0500
commite3a2ab391d8946f458d6f0b3a4332bf0c0e13161 (patch)
treeb3d91d51ec7c374a1f8957a7e02c69f75d1a05dd
parentccccc2bfdd33b1e82bdd7c612fa3a99e0c8be567 (diff)
downloadtoybox-e3a2ab391d8946f458d6f0b3a4332bf0c0e13161.tar.gz
Cleanup getenforce.
-rw-r--r--toys/pending/getenforce.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/toys/pending/getenforce.c b/toys/pending/getenforce.c
index ce43f523..71ae2032 100644
--- a/toys/pending/getenforce.c
+++ b/toys/pending/getenforce.c
@@ -7,6 +7,7 @@ USE_GETENFORCE(NEWTOY(getenforce, "", TOYFLAG_USR|TOYFLAG_SBIN))
config GETENFORCE
bool "getenforce"
default n
+ depends on TOYBOX_SELINUX
help
usage: getenforce
@@ -15,17 +16,14 @@ config GETENFORCE
#define FOR_getenforce
#include "toys.h"
-#include <selinux/selinux.h>
void getenforce_main(void)
{
- if (!is_selinux_enabled())
- printf("Disabled\n");
+ if (!is_selinux_enabled()) puts("Disabled");
else {
int ret = security_getenforce();
- if (ret == -1)
- perror_exit("Couldn't get enforcing status");
- else
- printf(ret ? "Enforcing\n" : "Permissive\n");
+
+ if (ret == -1) perror_exit("Couldn't get enforcing status");
+ else puts(ret ? "Enforcing" : "Permissive");
}
}