coproc and existing variables

2016-04-21 Thread Grisha Levit
A few issues inspired by the coproc proposal in this thread: http://lists.gnu.org/archive/html/bug-bash/2016-04/msg00050.html 1. coproc unsets readonly NAME after the process completes $ declare -p UID; coproc UID { :; }; wait; declare -p UID declare -ir UID="501" bash: UID: readonly variable bas

Re: coproc and existing variables

2016-04-21 Thread Piotr Grzybowski
On 21 Apr 2016, at 09:36, Grisha Levit wrote: > A few issues inspired by the coproc proposal in this thread: > http://lists.gnu.org/archive/html/bug-bash/2016-04/msg00050.html > > 1. coproc unsets readonly NAME after the process completes [..] > 2. Segfault if NAME is an existing associative ar

RE: Bug in syntax checking causes unintended running of a function

2016-04-21 Thread dnade.ext
Hi For the record it does not work with "fake" exported functions. I was scared this could be really bad be so I've tested this case : Here is inject.py #!/usr/bin/python -tt import os os.putenv('BASH_FUNC_foo%%', '''() { avg=0; avg=((avg+6)); echo -n "This function was never called. Bash versio

Re: coproc and existing variables

2016-04-21 Thread Chet Ramey
On 4/21/16 12:36 AM, Grisha Levit wrote: > A few issues inspired by the coproc proposal in this > thread: http://lists.gnu.org/archive/html/bug-bash/2016-04/msg00050.html > > 1. coproc unsets readonly NAME after the process completes Yes. This is a gray area. Under some circumstances, e.g, geto

completion-prefix-display-length doesn't check for common prefix

2016-04-21 Thread Grisha Levit
f() { COMPREPLY=(aa bb cc); } complete -F f f bind 'set completion-prefix-display-length 2' $ f [TAB][TAB] ...aa ...bb ...cc None of the completion entries share a common prefix, though the docs suggest that only common prefixes a

Re: coproc and existing variables

2016-04-21 Thread Grisha Levit
On Thu, Apr 21, 2016 at 1:22 PM, Chet Ramey wrote: > > > 1. coproc unsets readonly NAME after the process completes > > Yes. This is a gray area. Under some circumstances, e.g, getopts with > OPTARG, defined shell behavior can override a readonly setting. Probably should at least disallow this

compgen -A arrayvar does not include associative arrays

2016-04-21 Thread Grisha Levit
$ echo ${BASH_CMDS@a}; compgen -A arrayvar BASH_CMDS; echo $? A 1 The description doesn't specify that the output is limited to indexed arrays only and it would be nice to have associative array variables included as well. I had a recent use case for this when adding array index completion to bas

Scripts passed into "-c" with an embedded newline won't execute trap if last command fails

2016-04-21 Thread Brian Vandenberg
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-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -D

history separates >| and 2>&1 tokens when recalled with !*

2016-04-21 Thread idallen
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' -DPACKA

Possibly Bash explot

2016-04-21 Thread Nikolay Kolev
Basically, after doing a bunch of unset -f, I can crash Bash, version GNU bash, version 4.3.42(1)-release (x86_64-apple-darwin15.0.0), which could possibly be an attack vector. Here's the info from /var/log/system.log Apr 21 15:45:00 NikolayKolev-mac iTerm2[87962]: ReceiveMessageAndFileDescriptor