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' -D$ uname output: Linux desktop 2.6.35-32-generic #64-Ubuntu SMP Tue Jan 3 00:47:07 UTC 2012 x86_64 GNU/Linux Machine Type: x86_64-pc-linux-gnu
Bash Version: 4.1 Patch Level: 5 Release Status: release Description: Debian's bash (compiled with -DSYS_BASHRC) documentation says "--rcfile file: Execute commands from file instead of the system wide initialization file /etc/bash.bashrc and the standard personal initialization file ~/.bashrc if the shell is interactive." But testing shows that /etc/bash.bashrc is being executed even when --rcfile is used. So the only way for the user to disable the system-wide rc is to use the --norc option, which also disables both ~/.bashrc and any custom rc specified in --rcfile User should be able to prevent system rc and selecting a custom rc by using the --rcfile option, as per the documentation. Repeat-By: from any terminal: $ sudo echo "echo systemrc" > /etc/bash.bashrc $ echo "echo customrc" > ~/customrc $ echo "echo bashrc" > ~/.bashrc $ bash systemrc bashrc $ bash --rcfile ~/customrc --norc $ Current behavior: $ bash --rcfile ~/customrc systemrc customrc $ Expected behavior: $ bash --rcfile ~/customrc customrc $ Fix: To fix the behavior so it matches the documentation, SYS_BASHRC should only be executed if --rcfile is NOT used. Also, documentation should be updated to clarify that --norc option disables --rcfile option. Last but not least, -DSYS_BASHRC compile option should be properly documented, or at least included in configure options (as in --enable-system-bashrc) The attached files are: 0000-xxx.patch: enables SYS_BASHRC so bug can be reproduced and the fix can be tested 0001-xxx.patch: Fixes the bug. This is the ONLY patch meant for merge. They were succesfully tested on git "master" branch (4.2 patchlevel 20) Sincerely, Rodrigo Silva (MestreLion in Launchpad)
0000-SYS_BASHRC-enabled-in-config-top.h.patch
Description: Binary data
0001-SYS_BASHRC-do-not-execute-etc-bash.bashrc-if-rcfile-is-set.patch
Description: Binary data