From 457825f77a7c7286647ee888a1000a6bb12ca8fc Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 6 Jun 2021 12:07:11 +0200 Subject: 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 --- shell/ash.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'shell/ash.c') 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 */ -- cgit v1.1