comparison toys/android/runcon.c @ 1753:0f940c4f9658 draft

Promote runcon to android (and add an android menu).
author Rob Landley <rob@landley.net>
date Mon, 23 Mar 2015 13:45:47 -0500
parents toys/pending/runcon.c@2d51d89b9d79
children
comparison
equal deleted inserted replaced
1752:2d51d89b9d79 1753:0f940c4f9658
1 /* runcon.c - Run command in specified security context
2 *
3 * Copyright 2015 The Android Open Source Project
4
5 USE_RUNCON(NEWTOY(runcon, "<2", TOYFLAG_USR|TOYFLAG_SBIN))
6
7 config RUNCON
8 bool "runcon"
9 depends on TOYBOX_SELINUX
10 default y
11 help
12 usage: runcon CONTEXT COMMAND [ARGS...]
13
14 Run a command in a specified security context.
15 */
16
17 #define FOR_runcon
18 #include "toys.h"
19
20 void runcon_main(void)
21 {
22 char *context = *toys.optargs;
23
24 if (setexeccon(context)) perror_exit("Could not set context to %s", context);
25
26 xexec(++toys.optargs);
27 }