2013-01-08 20:56:34 |
Hugo Heden |
bug |
|
|
added bug |
2022-08-23 18:26:27 |
Dave Jones |
summary |
bash does not fulfill --bashrc option properly |
bash does not fulfill --rcfile option properly |
|
2022-08-23 18:26:51 |
Dave Jones |
description |
I am starting a bash shell using
$ bash --noprofile --bashrc my-custom-bash-rc-file
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
Execute commands from file instead of the system wide initialization file /etc/bash.bashrc and the standard personal initial‐
ization file ~/.bashrc if the shell is interactive (see INVOCATION below).
However, it seems that the commands in /etc/bash.bashrc are in fact executed.
To see/reproduce/diagnose this, on Ubuntu I believe one can just invoke bash like this (as the regular user):
$ 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 --bashrc 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. |
I am starting a bash shell using
$ bash --noprofile --rcfile my-custom-bash-rc-file
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
Execute commands from file instead of the system wide initialization file /etc/bash.bashrc and the standard personal initial‐
ization file ~/.bashrc if the shell is interactive (see INVOCATION below).
However, it seems that the commands in /etc/bash.bashrc are in fact executed.
To see/reproduce/diagnose this, on Ubuntu I believe one can just invoke bash like this (as the regular user):
$ 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. |
|
2022-08-23 18:26:52 |
Launchpad Janitor |
bash (Ubuntu): status |
New |
Confirmed |
|
2022-08-23 22:06:42 |
Dave Jones |
attachment added |
|
bash-is-wrong.debdiff https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1097467/+attachment/5611100/+files/bash-is-wrong.debdiff |
|
2022-08-23 22:06:58 |
Dave Jones |
attachment added |
|
manpage-is-wrong.debdiff https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1097467/+attachment/5611101/+files/manpage-is-wrong.debdiff |
|
2022-08-23 22:07:08 |
Dave Jones |
bug |
|
|
added subscriber Ubuntu Sponsors Team |
2022-08-23 22:07:19 |
Dave Jones |
tags |
|
rls-kk-incoming |
|
2022-09-29 15:21:03 |
Julian Andres Klode |
tags |
rls-kk-incoming |
|
|
2022-09-30 17:00:45 |
Nick Rosbrook |
bash (Ubuntu): importance |
Undecided |
Low |
|
2023-01-25 20:24:34 |
Simon Quigley |
removed subscriber Ubuntu Sponsors Team |
|
|
|
2023-11-14 11:56:13 |
Dave Jones |
bug watch added |
|
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=516152 |
|
2023-11-14 11:56:13 |
Dave Jones |
bug watch added |
|
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=343673 |
|
2023-11-14 11:57:11 |
Dave Jones |
bug task added |
|
gnubash |
|
2023-11-14 12:10:52 |
Dave Jones |
attachment added |
|
1097467-1.debdiff https://bugs.launchpad.net/gnubash/+bug/1097467/+attachment/5719274/+files/1097467-1.debdiff |
|
2023-11-14 12:11:02 |
Dave Jones |
bug |
|
|
added subscriber Ubuntu Sponsors |
2023-11-14 12:25:42 |
Bug Watch Updater |
gnubash: status |
Unknown |
New |
|
2023-11-14 16:47:53 |
Dave Jones |
attachment added |
|
1097467-2.debdiff https://bugs.launchpad.net/gnubash/+bug/1097467/+attachment/5719318/+files/1097467-2.debdiff |
|
2023-11-14 18:57:29 |
Dan Bungert |
bash (Ubuntu): assignee |
|
Dan Bungert (dbungert) |
|
2023-11-14 18:57:32 |
Dan Bungert |
bash (Ubuntu): status |
Confirmed |
Fix Committed |
|
2023-11-15 12:40:41 |
Graham Inggs |
removed subscriber Ubuntu Sponsors |
|
|
|
2024-03-11 22:49:18 |
Ralf Rumbler |
bug |
|
|
added subscriber Ralf Rumbler |
2024-04-11 20:51:29 |
Dave Jones |
bash (Ubuntu): status |
Fix Committed |
Confirmed |
|
2024-04-11 20:51:35 |
Dave Jones |
bash (Ubuntu): assignee |
Dan Bungert (dbungert) |
Dave Jones (waveform) |
|
2024-04-16 20:54:25 |
Dave Jones |
attachment added |
|
1097467-3.debdiff https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1097467/+attachment/5766422/+files/1097467-3.debdiff |
|
2024-04-16 20:54:34 |
Dave Jones |
bug |
|
|
added subscriber Ubuntu Sponsors |
2024-05-27 12:24:40 |
Launchpad Janitor |
bash (Ubuntu): status |
Confirmed |
Fix Released |
|
2024-08-11 19:41:58 |
Bug Watch Updater |
gnubash: status |
New |
Confirmed |
|