bash does not fulfill --rcfile option properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Gnu Bash |
Confirmed
|
Unknown
|
|||
bash (Ubuntu) |
Fix Released
|
Low
|
Dave Jones |
Bug Description
I am starting a bash shell using
$ bash --noprofile --rcfile my-custom-
Due to the --rcflag, the newly started bash should *not* execute commands from /etc/bash.bashrc. That is at least how I interpret `man bash`:
--rcfile file
However, it seems that the commands in /etc/bash.bashrc are in fact executed.
To see/reproduce/
$ touch testrc
$ env -i bash --noprofile --rcfile testrc
The expected result would be that nothing special is printed on the terminal. However, there is an error message, which is printed from /etc/bash.bashrc. The "env -i" causes $HOME to not be set in the invoked shell, which in turn triggers the error. The error message is:
> To run a command as administrator (user "root"), use "sudo <command>".
> See "man sudo_root" for details.
Another way to see this -- without the "env -i" -- is to add a command to /etc/bash.bashrc, such as
echo HELLO THERE
To trigger the bug(?), one can then just do
$ touch testrc
$ bash --noprofile --rcfile testrc
The expected result would be that nothing special is shown in the terminal. However, it turns out that the string
HELLO THERE
is printed.
summary: |
- bash does not fulfill --bashrc option properly + bash does not fulfill --rcfile option properly |
description: | updated |
Changed in bash (Ubuntu): | |
importance: | Undecided → Low |
Changed in gnubash: | |
status: | Unknown → New |
Changed in gnubash: | |
status: | New → Confirmed |
$ lsb_release --all
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal
$ bash --version pc-linux- gnu) gnu.org/ licenses/ gpl.html>
GNU bash, version 4.2.37(1)-release (x86_64-
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.