bug-bash
[Top][All Lists]
Advanced

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

bash 4.x filters out environmental variables containing a dot in the nam


From: Christian Krause
Subject: bash 4.x filters out environmental variables containing a dot in the name
Date: Thu, 25 Jun 2009 21:47:59 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090320 Fedora/2.0.0.21-1.fc10 Thunderbird/2.0.0.21 Mnenhy/0.7.5.0

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu'
-DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib  -D_GNU_SOURCE
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic
-fasynchronous-unwind-tables
uname output: Linux noname 2.6.29.4-167.fc11.i686.PAE #1 SMP Wed May 27
17:28:22 EDT 2009 i686 i686 i386 GNU/Linux
Machine Type: i386-redhat-linux-gnu

Bash Version: 4.0
Patch Level: 16
Release Status: release

Description:
During the compilation of the linux kernel (configured to user mode
linux) I've discovered the following problem of bash 4.0 (which is now
delivered by Fedora 11):

If an environmental variable contains a "." in its name, the new bash
4.0 filters out these variables. They will not be visible via "set" nor
will they be inherited to executed sub-shells or processes.

This behavior explains the compile problem:
- the kernel's make system uses make variables like
"CPPFLAGS_vmlinux.lds"
- they are exported via "export" in the Makefile
- subsequent make processes are started (via bash, since SHELL=/bin/bash
is set in the Makefile)
- they don't get the variable inherited, because the bash filters it out
- the build will fail since the called Makefile expects this variable

I've installed for testing purposes bash 3.2 on this system and the
problems were gone.


Repeat-By:

Fedora 10 (GNU bash, version 3.2.39(1)-release (i386-redhat-linux-gnu))
$ env foo.foo=bar bash
$ set |grep foo
foo.foo=bar
$ cat /proc/$$/environ |grep foo\.foo
Binary file (standard input) matches
$ bash
$ set |grep foo
foo.foo=bar

Fedora 11 (GNU bash, version 4.0.16(1)-release (i386-redhat-linux-gnu))
$ env foo.foo=bar bash
$ set |grep foo
$ cat /proc/$$/environ |grep foo\.foo
Binary file (standard input) matches
$ bash
$ set |grep foo
$ cat /proc/$$/environ |grep foo\.foo
$

This shows, that in F11:
* the environment variable foo.foo is not added to the bash's list of
environment variables accessible via "set"
* the variable is still in the process's environment
* the variable will be filtered out when the bash executes a subsequent
process

This change may also affect other make-based build systems which rely on
the fact that a make variable which is exported via the keyword "export"
in the Makefile is accessible in nested calls of make.


Best regards,
Christian




reply via email to

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