[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: built-in commands give no syntax error on trailing garbage
From: |
Piotr Grzybowski |
Subject: |
Re: built-in commands give no syntax error on trailing garbage |
Date: |
Wed, 14 Sep 2016 18:24:50 +0200 |
hi,
this is recurring cd story:
https://lists.gnu.org/archive/html/bug-bash/2016-04/msg00038.html
pg
On 14 Sep 2016, at 12:01, idallen@home.idallen.ca wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: x86_64
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
> -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
> -DHAVE_CONFIG_H -I. -I../. -I.././include -I.././lib -Wdate-time
> -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat
> -Werror=format-security -Wall
> uname output: Linux idallen-oak 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11
> 18:01:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
> Machine Type: x86_64-pc-linux-gnu
>
> Bash Version: 4.3
> Patch Level: 46
> Release Status: release
>
> Description:
> Many built-in commands ignore trailing garbage instead of giving
> a syntax error, and this leads newbies into making dumb mistakes
> that they think work fine because of no error message, e.g.:
>
> $ umask 0777 myfile # should have been chmod
> $ cd /usr /bin # goes to /usr not to intended /usr/bin
>
> Commands should never ignore user input. If it's there, someone
> thinks it should be used. Use it or please give error messages.
>
> Repeat-By:
> $ cd /bin this trailing garbage is ignored but should give an error
>
> $ pushd /bin this trailing garbage is ignored but should give an error
>
> $ umask 022 this trailing garbage is ignored but should give an error
>
> $ help help this trailing garbage is ignored but should give an error
>
> etc.
>
> Fix:
> Make built-in commands give error messages if given too many arguments.
>