diff options
Diffstat (limited to 'toolbox')
| -rw-r--r-- | toolbox/kill.c | 2 | ||||
| -rw-r--r-- | toolbox/restorecon.c | 19 | ||||
| -rw-r--r-- | toolbox/setenforce.c | 2 |
3 files changed, 10 insertions, 13 deletions
diff --git a/toolbox/kill.c b/toolbox/kill.c index b79805f..fa2f649 100644 --- a/toolbox/kill.c +++ b/toolbox/kill.c @@ -42,7 +42,9 @@ static struct { /* non-SUS signals */ _SIG(IO), _SIG(PWR), +#ifdef SIGSTKFLT _SIG(STKFLT), +#endif _SIG(WINCH), #undef _SIG }; diff --git a/toolbox/restorecon.c b/toolbox/restorecon.c index 5ef0ef1..f9f604f 100644 --- a/toolbox/restorecon.c +++ b/toolbox/restorecon.c @@ -7,8 +7,7 @@ #include <fts.h> #include <selinux/selinux.h> #include <selinux/label.h> - -#define FCPATH "/file_contexts" +#include <selinux/android.h> static struct selabel_handle *sehandle; static const char *progname; @@ -17,7 +16,7 @@ static int verbose; static void usage(void) { - fprintf(stderr, "usage: %s [-f file_contexts] [-nrRv] pathname...\n", progname); + fprintf(stderr, "usage: %s [-nrRv] pathname...\n", progname); exit(1); } @@ -54,21 +53,16 @@ static int restore(const char *pathname, const struct stat *sb) int restorecon_main(int argc, char **argv) { - struct selinux_opt seopts[] = { - { SELABEL_OPT_PATH, FCPATH } - }; int ch, recurse = 0, ftsflags = FTS_PHYSICAL; + int i = 0; progname = argv[0]; do { - ch = getopt(argc, argv, "f:nrRv"); + ch = getopt(argc, argv, "nrRv"); if (ch == EOF) break; switch (ch) { - case 'f': - seopts[0].value = optarg; - break; case 'n': nochange = 1; break; @@ -89,9 +83,10 @@ int restorecon_main(int argc, char **argv) if (!argc) usage(); - sehandle = selabel_open(SELABEL_CTX_FILE, seopts, 1); + sehandle = selinux_android_file_context_handle(); + if (!sehandle) { - fprintf(stderr, "Could not load file contexts from %s: %s\n", seopts[0].value, + fprintf(stderr, "Could not load file_contexts: %s\n", strerror(errno)); return -1; } diff --git a/toolbox/setenforce.c b/toolbox/setenforce.c index 1b0ea5c..444073d 100644 --- a/toolbox/setenforce.c +++ b/toolbox/setenforce.c @@ -7,7 +7,7 @@ #include <errno.h> #include <selinux/selinux.h> -void usage(const char *progname) +static void usage(const char *progname) { fprintf(stderr, "usage: %s [ Enforcing | Permissive | 1 | 0 ]\n", progname); |
