aboutsummaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-09-21 09:29:58 +0100
committerRon Yorston <rmy@pobox.com>2024-09-21 09:29:58 +0100
commitd1dbec40901f3e3a998be15354c3a9fbeb93d7bf (patch)
treed54d1ffc0a18e51ab66922c771386fe71ddf38c0 /shell/ash.c
parent9376eebd8d16ce38278ee709177e9e7fd5d7ec14 (diff)
downloadbusybox-w32-d1dbec40901f3e3a998be15354c3a9fbeb93d7bf.tar.gz
busybox-w32-d1dbec40901f3e3a998be15354c3a9fbeb93d7bf.tar.bz2
busybox-w32-d1dbec40901f3e3a998be15354c3a9fbeb93d7bf.zip
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)
Diffstat (limited to '')
-rw-r--r--shell/ash.c5
1 files changed, 5 insertions, 0 deletions
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)
12821 if (val && (c == '-')) { /* long options */ 12821 if (val && (c == '-')) { /* long options */
12822 if (strcmp(p, "login") == 0) { 12822 if (strcmp(p, "login") == 0) {
12823 *login_sh = 1; 12823 *login_sh = 1;
12824#if ENABLE_PLATFORM_MINGW32
12825 break;
12826#endif
12824 } 12827 }
12825/* TODO: --noprofile: e.g. if I want to run emergency shell from sulogin, 12828/* TODO: --noprofile: e.g. if I want to run emergency shell from sulogin,
12826 * I want minimal/no shell init scripts - but it insists on running it as "-ash"... 12829 * I want minimal/no shell init scripts - but it insists on running it as "-ash"...
12827 */ 12830 */
12831#if !ENABLE_PLATFORM_MINGW32
12828 break; 12832 break;
12833#endif
12829 } 12834 }
12830 } 12835 }
12831 if (c == 'o') { 12836 if (c == 'o') {