[Top][All Lists]

[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: Gecko/20090320 Fedora/ Thunderbird/ Mnenhy/

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
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic
uname output: Linux noname #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

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
- 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.


Fedora 10 (GNU bash, version 3.2.39(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

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

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,

reply via email to

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