bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Environment parsed for Functions when invoked as rbash (and sh)


From: Paul FM
Subject: Environment parsed for Functions when invoked as rbash (and sh)
Date: Fri, 03 Oct 2014 16:37:47 -0500
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:25.0) Gecko/20100101 Firefox/25.0 SeaMonkey/2.22.1

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc -I/home/abuild/rpmbuild/BUILD/bash-4.2 -L/home/abuild/rpmbuild/BU\
ILD/bash-4.2/../readline-6.2
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='l\ inux-gnu' -DCONF_MACHTYPE='x86_64-suse-linux-gnu' -DCONF_VENDOR='suse' -DLOCALE\ DIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I.\ /include -I./lib -fmessage-length=0 -grecord-gcc-switches -fstack-protector -\ O2 -Wall -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -g -\ D_GNU_SOURCE -DRECYCLES_PIDS -Wall -g -std=gnu89 -Wuninitialized -Wextra -Wno-u\ nprototyped-calls -Wno-switch-enum -Wno-unused-variable -Wno-unused-parameter -\
ftree-loop-linear -pipe -DBNC382214=0 -fprofile-use
uname output: Linux enet-h1n1 3.11.10-21-default #1 SMP Mon Jul 21 15:28:46 UTC\
 2014 (9a9565d) x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-suse-linux-gnu

Bash Version: 4.2
Patch Level: 47
Release Status: release



Description:
When run as rbash, it parses then environment for functions when the man page specifically says it does NOT do this. It is also UNEXPECTED for bash run as "sh" to import fuctions from the environment (which it also seems to do).

Repeat-By:
while running bash:
        export Y=\(\)\ \{\ ignored\;\ \}\;\ /usr/bin/id
        rbash
        (same with sh)
Note the error message which means rbash and sh are parsing the environment to find functions.



Fix:
When bash is run as rbash or sh it should NOT parse the inherited environment for functions (nor for options).

Actually, I suggest bash be modified to ONLY parse the environment for functions when it is specifically invoked as bash - and act as rbash when invoked as any unrecognized name.


--
---------------------------------------------------------------------
The views and opinions expressed above are strictly
those of the author(s).  The content of this message has
not been reviewed nor approved by any entity whatsoever.
I should not be considered an "AUTHORITY" on any subject.
---------------------------------------------------------------------
Paul FM               Info: http://www.umn.edu/~paulfm/
---------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]