diff options
author | Denys Vlasenko | 2021-06-06 12:07:11 +0200 |
---|---|---|
committer | Denys Vlasenko | 2021-06-06 12:08:43 +0200 |
commit | 457825f77a7c7286647ee888a1000a6bb12ca8fc (patch) | |
tree | f4deac5510cbae6299b964f48d4c8cad8bde3ce4 /shell/ash.c | |
parent | a1b0d3856d9a0419cb74bf4c87525265871b5868 (diff) | |
download | busybox-457825f77a7c7286647ee888a1000a6bb12ca8fc.zip busybox-457825f77a7c7286647ee888a1000a6bb12ca8fc.tar.gz |
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 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index 05c4795..bcf7a34 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -14161,6 +14161,10 @@ readcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) } } + if (!ENABLE_ASH_BASH_COMPAT && !argptr) { + bb_simple_error_msg("read: need variable name"); + return 1; + } params.argv = argptr; params.setvar = setvar0; params.ifs = bltinlookup("IFS"); /* can be NULL */ |