aboutsummaryrefslogtreecommitdiff
path: root/libbb/getopt32.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-06-06 12:07:11 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2021-06-06 12:08:43 +0200
commit457825f77a7c7286647ee888a1000a6bb12ca8fc (patch)
treef4deac5510cbae6299b964f48d4c8cad8bde3ce4 /libbb/getopt32.c
parenta1b0d3856d9a0419cb74bf4c87525265871b5868 (diff)
downloadbusybox-w32-457825f77a7c7286647ee888a1000a6bb12ca8fc.tar.gz
busybox-w32-457825f77a7c7286647ee888a1000a6bb12ca8fc.tar.bz2
busybox-w32-457825f77a7c7286647ee888a1000a6bb12ca8fc.zip
shells: do not allow bare "read" in non-bash compat configs
On Sat, Feb 9, 2019 Cristian Ionescu-Idbohrn wrote: > In my case (at work), I have to watch and prevent people from doing > unportable things. For me, that's a burden. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/getopt32.c')
-rw-r--r--libbb/getopt32.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libbb/getopt32.c b/libbb/getopt32.c
index 378510063..5ab4d66f1 100644
--- a/libbb/getopt32.c
+++ b/libbb/getopt32.c
@@ -89,6 +89,12 @@ getopt32(char **argv, const char *applet_opts, ...)
89 root:x:0:0:root:/root:/bin/bash 89 root:x:0:0:root:/root:/bin/bash
90 user:x:500:500::/home/user:/bin/bash 90 user:x:500:500::/home/user:/bin/bash
91 91
92 "^" options string is "^optchars""\0""opt_complementary".
93
94 "!" If the first character in the applet_opts string is a '!',
95 report bad options, missing required options,
96 inconsistent options with all-ones return value (instead of abort.
97
92 "+" If the first character in the applet_opts string is a plus, 98 "+" If the first character in the applet_opts string is a plus,
93 then option processing will stop as soon as a non-option is 99 then option processing will stop as soon as a non-option is
94 encountered in the argv array. Useful for applets like env 100 encountered in the argv array. Useful for applets like env
@@ -96,10 +102,7 @@ getopt32(char **argv, const char *applet_opts, ...)
96 env -i ls -d / 102 env -i ls -d /
97 Here we want env to process just the '-i', not the '-d'. 103 Here we want env to process just the '-i', not the '-d'.
98 104
99 "!" Report bad options, missing required options, 105 (The order of multiple prefixes must be "^!+...")
100 inconsistent options with all-ones return value (instead of abort).
101
102 "^" options string is "^optchars""\0""opt_complementary".
103 106
104uint32_t 107uint32_t
105getopt32long(char **argv, const char *applet_opts, const char *logopts...) 108getopt32long(char **argv, const char *applet_opts, const char *logopts...)