From d1dbec40901f3e3a998be15354c3a9fbeb93d7bf Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sat, 21 Sep 2024 09:29:58 +0100 Subject: ash: reject unknown long options Commit 64f70cc755 (Add --login support) added code in options() to handle the bash-compatible '--login' option. In doing so it committed BusyBox ash to silently accepting all other long options. Restore compatibility with other ash variants by rejecting unknown long options. (GitHub issue #457) --- shell/ash.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shell/ash.c b/shell/ash.c index 5f231385a..8bbc19d1f 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -12821,11 +12821,16 @@ options(int *login_sh) if (val && (c == '-')) { /* long options */ if (strcmp(p, "login") == 0) { *login_sh = 1; +#if ENABLE_PLATFORM_MINGW32 + break; +#endif } /* TODO: --noprofile: e.g. if I want to run emergency shell from sulogin, * I want minimal/no shell init scripts - but it insists on running it as "-ash"... */ +#if !ENABLE_PLATFORM_MINGW32 break; +#endif } } if (c == 'o') { -- cgit v1.2.3-55-g6feb