diff options
Diffstat (limited to 'selinux/runcon.c')
-rw-r--r-- | selinux/runcon.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/selinux/runcon.c b/selinux/runcon.c index 09082d6c2..a5a394427 100644 --- a/selinux/runcon.c +++ b/selinux/runcon.c | |||
@@ -34,11 +34,6 @@ | |||
34 | //config: depends on SELINUX | 34 | //config: depends on SELINUX |
35 | //config: help | 35 | //config: help |
36 | //config: Enable support to run command in specified security context. | 36 | //config: Enable support to run command in specified security context. |
37 | //config: | ||
38 | //config:config FEATURE_RUNCON_LONG_OPTIONS | ||
39 | //config: bool "Enable long options" | ||
40 | //config: default y | ||
41 | //config: depends on RUNCON && LONG_OPTS | ||
42 | 37 | ||
43 | //applet:IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) | 38 | //applet:IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) |
44 | 39 | ||
@@ -50,20 +45,11 @@ | |||
50 | //usage:#define runcon_full_usage "\n\n" | 45 | //usage:#define runcon_full_usage "\n\n" |
51 | //usage: "Run PROG in a different security context\n" | 46 | //usage: "Run PROG in a different security context\n" |
52 | //usage: "\n CONTEXT Complete security context\n" | 47 | //usage: "\n CONTEXT Complete security context\n" |
53 | //usage: IF_FEATURE_RUNCON_LONG_OPTIONS( | ||
54 | //usage: "\n -c,--compute Compute process transition context before modifying" | ||
55 | //usage: "\n -t,--type TYPE Type (for same role as parent)" | ||
56 | //usage: "\n -u,--user USER User identity" | ||
57 | //usage: "\n -r,--role ROLE Role" | ||
58 | //usage: "\n -l,--range RNG Levelrange" | ||
59 | //usage: ) | ||
60 | //usage: IF_NOT_FEATURE_RUNCON_LONG_OPTIONS( | ||
61 | //usage: "\n -c Compute process transition context before modifying" | 48 | //usage: "\n -c Compute process transition context before modifying" |
62 | //usage: "\n -t TYPE Type (for same role as parent)" | 49 | //usage: "\n -t TYPE Type (for same role as parent)" |
63 | //usage: "\n -u USER User identity" | 50 | //usage: "\n -u USER User identity" |
64 | //usage: "\n -r ROLE Role" | 51 | //usage: "\n -r ROLE Role" |
65 | //usage: "\n -l RNG Levelrange" | 52 | //usage: "\n -l RNG Levelrange" |
66 | //usage: ) | ||
67 | 53 | ||
68 | #include <selinux/context.h> | 54 | #include <selinux/context.h> |
69 | /* from deprecated <selinux/flask.h>: */ | 55 | /* from deprecated <selinux/flask.h>: */ |
@@ -108,7 +94,7 @@ static context_t runcon_compute_new_context(char *user, char *role, char *type, | |||
108 | return con; | 94 | return con; |
109 | } | 95 | } |
110 | 96 | ||
111 | #if ENABLE_FEATURE_RUNCON_LONG_OPTIONS | 97 | #if ENABLE_LONG_OPTS |
112 | static const char runcon_longopts[] ALIGN1 = | 98 | static const char runcon_longopts[] ALIGN1 = |
113 | "user\0" Required_argument "u" | 99 | "user\0" Required_argument "u" |
114 | "role\0" Required_argument "r" | 100 | "role\0" Required_argument "r" |
@@ -140,11 +126,12 @@ int runcon_main(int argc UNUSED_PARAM, char **argv) | |||
140 | 126 | ||
141 | selinux_or_die(); | 127 | selinux_or_die(); |
142 | 128 | ||
143 | #if ENABLE_FEATURE_RUNCON_LONG_OPTIONS | 129 | opts = getopt32long(argv, "^" |
144 | applet_long_options = runcon_longopts; | 130 | "r:t:u:l:ch" |
145 | #endif | 131 | "\0" "-1", |
146 | opt_complementary = "-1"; | 132 | runcon_longopts, |
147 | opts = getopt32(argv, "r:t:u:l:ch", &role, &type, &user, &range); | 133 | &role, &type, &user, &range |
134 | ); | ||
148 | argv += optind; | 135 | argv += optind; |
149 | 136 | ||
150 | if (!(opts & OPTS_CONTEXT_COMPONENT)) { | 137 | if (!(opts & OPTS_CONTEXT_COMPONENT)) { |