[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
built-in commands give no syntax error on trailing garbage
From: |
idallen |
Subject: |
built-in commands give no syntax error on trailing garbage |
Date: |
Wed, 14 Sep 2016 06:01:57 -0400 (EDT) |
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.
- built-in commands give no syntax error on trailing garbage,
idallen <=