diff options
Diffstat (limited to 'util-linux/unshare.c')
-rw-r--r-- | util-linux/unshare.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/util-linux/unshare.c b/util-linux/unshare.c index e7b95c72b..6a3da9f91 100644 --- a/util-linux/unshare.c +++ b/util-linux/unshare.c | |||
@@ -137,7 +137,7 @@ static const struct namespace_descr ns_list[] = { | |||
137 | * we are forced to use "fake" letters for them. | 137 | * we are forced to use "fake" letters for them. |
138 | * '+': stop at first non-option. | 138 | * '+': stop at first non-option. |
139 | */ | 139 | */ |
140 | static const char opt_str[] ALIGN1 = "+muinpU""fr""\xfd::""\xfe:""\xff:"; | 140 | #define OPT_STR "+muinpU""fr""\xfd::""\xfe:""\xff:" |
141 | static const char unshare_longopts[] ALIGN1 = | 141 | static const char unshare_longopts[] ALIGN1 = |
142 | "mount\0" Optional_argument "\xf0" | 142 | "mount\0" Optional_argument "\xf0" |
143 | "uts\0" Optional_argument "\xf1" | 143 | "uts\0" Optional_argument "\xf1" |
@@ -210,7 +210,7 @@ int unshare_main(int argc UNUSED_PARAM, char **argv) | |||
210 | prop_str = PRIVATE_STR; | 210 | prop_str = PRIVATE_STR; |
211 | setgrp_str = NULL; | 211 | setgrp_str = NULL; |
212 | 212 | ||
213 | opt_complementary = | 213 | opts = getopt32long(argv, "^" OPT_STR "\0" |
214 | "\xf0""m" /* long opts (via their "fake chars") imply short opts */ | 214 | "\xf0""m" /* long opts (via their "fake chars") imply short opts */ |
215 | ":\xf1""u" | 215 | ":\xf1""u" |
216 | ":\xf2""i" | 216 | ":\xf2""i" |
@@ -219,16 +219,14 @@ int unshare_main(int argc UNUSED_PARAM, char **argv) | |||
219 | ":\xf5""U" | 219 | ":\xf5""U" |
220 | ":ru" /* --map-root-user or -r implies -u */ | 220 | ":ru" /* --map-root-user or -r implies -u */ |
221 | ":\xfd""m" /* --mount-proc implies -m */ | 221 | ":\xfd""m" /* --mount-proc implies -m */ |
222 | ; | 222 | , unshare_longopts, |
223 | applet_long_options = unshare_longopts; | 223 | &proc_mnt_target, &prop_str, &setgrp_str, |
224 | opts = getopt32(argv, opt_str, | 224 | &ns_ctx_list[NS_MNT_POS].path, |
225 | &proc_mnt_target, &prop_str, &setgrp_str, | 225 | &ns_ctx_list[NS_UTS_POS].path, |
226 | &ns_ctx_list[NS_MNT_POS].path, | 226 | &ns_ctx_list[NS_IPC_POS].path, |
227 | &ns_ctx_list[NS_UTS_POS].path, | 227 | &ns_ctx_list[NS_NET_POS].path, |
228 | &ns_ctx_list[NS_IPC_POS].path, | 228 | &ns_ctx_list[NS_PID_POS].path, |
229 | &ns_ctx_list[NS_NET_POS].path, | 229 | &ns_ctx_list[NS_USR_POS].path |
230 | &ns_ctx_list[NS_PID_POS].path, | ||
231 | &ns_ctx_list[NS_USR_POS].path | ||
232 | ); | 230 | ); |
233 | argv += optind; | 231 | argv += optind; |
234 | //bb_error_msg("opts:0x%x", opts); | 232 | //bb_error_msg("opts:0x%x", opts); |