[Bug 589496] Re: bash --rcfile does not behave as documented
MestreLion
589496 at bugs.launchpad.net
Sun May 28 18:24:05 UTC 2023
> Why does Debian enable -DSYS_BASHRC? This question does not seem to be
answered anywhere.
It does make sense for Debian (and Ubuntu) to enable SYS_BASHRC by
default, as a system-wide /etc/bash.bashrc is a useful (and needed)
configuration tool for sysadmins. It's standard behavior for many
packages to read system-wide config file(s) from /etc and then merge
user settings from ~/.* or ~/.config, so I don't think this is the
issue.
> Is there a workaround? Can someone release an alternate version of
bash for Ubuntu without -DSYS_BASHRC?
There's no need for an alternate release: if you have enough privileges
to install system-wide software with apt, it means you're the admin who
can also edit /etc/bash.bashrc to be a blank file to effectively disable
it.
If you're not the admin but want a custom bash for your user, you can
compile bash yourself (without -DSYS_BASHRC or patched with a correct
--rcfile behavior) and install it at ~/.local/bin.
So admins can easily modify/disable /etc/bash.bashrc, and non-admins are
not supposed to be able to bypass it anyway, at least for login shells.
----
I believe the issue is not -DSYS_BASHRC being enabled by default, but
rather `--rcfile` not behaving as it should, and documentation that
mismatches current behavior.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bash in Ubuntu.
https://bugs.launchpad.net/bugs/589496
Title:
bash --rcfile does not behave as documented
Status in bash package in Ubuntu:
Confirmed
Status in bash package in Debian:
New
Bug description:
Binary package hint: bash
the bash manpage says this about --rcfile
--rcfile file
Execute commands from file instead of the system wide initial‐
ization file /etc/bash.bashrc and the standard personal initial‐
ization file ~/.bashrc if the shell is interactive (see INVOCA‐
TION below).
under INVOCATION it says
When an interactive shell that is not a login shell is started, bash
reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if
these files exist. This may be inhibited by using the --norc option.
The --rcfile file option will force bash to read and execute commands
from file instead of /etc/bash.bashrc and ~/.bashrc.
but when i execute
$ bash --rcfile somercfilewhichreallydoesexistandisreadableandall
it will still read /etc/bash/bashrc (can be verified by adding --verbose)
using lucid with bash 4.1-2ubuntu3
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/589496/+subscriptions
More information about the foundations-bugs
mailing list