[Bug 1088524] New: Recent aaa_base update breaks sourcing of bash.bashrc.local
http://bugzilla.opensuse.org/show_bug.cgi?id=1088524 Bug ID: 1088524 Summary: Recent aaa_base update breaks sourcing of bash.bashrc.local Classification: openSUSE Product: openSUSE Distribution Version: Leap 42.3 Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem Assignee: bnc-team-screening@forge.provo.novell.com Reporter: archie.cobbs@gmail.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- This commit created a bug: https://github.com/openSUSE/aaa_base/commit/b9a57d5a64b3d2d09bc591f894f6558f... The bug is that "unset is" was added to /etc/profile. That causes "is" to get unset on bash.bashrc when /etc/profile is invoked here (line 326): if test \( -n "$SSH_CONNECTION" -o -n "$SUDO_COMMAND" \) -a -z "$PROFILEREAD" ; then _SOURCED_FOR_SSH=true . /etc/profile > /dev/null 2>&1 unset _SOURCED_FOR_SSH fi As a result, all code following this point in bash.bashrc that depends on variable $is is broken. In particular, the sourcing of bash.bashrc.local. WTF this commit is attempting to do is unknown because the bug that motivated it is not public. Here's a proposed fix: --- bash.bashrc.orig 2018-04-06 15:28:43.298226415 -0500 +++ bash.bashrc 2018-04-06 15:29:33.962045536 -0500 @@ -324,8 +324,11 @@ # Just in case the user excutes a command with ssh or sudo # if test \( -n "$SSH_CONNECTION" -o -n "$SUDO_COMMAND" \) -a -z "$PROFILEREAD" ; then + _SAVED_IS="$is" _SOURCED_FOR_SSH=true . /etc/profile > /dev/null 2>&1 + is="$_SAVED_IS" + unset _SAVED_IS unset _SOURCED_FOR_SSH fi My recommendation is that if these files are going to be sourcing each other, then because bash has a global namespace, each file needs to use variable names that have some unique prefix or something. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1088524
http://bugzilla.opensuse.org/show_bug.cgi?id=1088524#c1
Andreas Stieger
http://bugzilla.opensuse.org/show_bug.cgi?id=1088524
http://bugzilla.opensuse.org/show_bug.cgi?id=1088524#c13
--- Comment #13 from Dr. Werner Fink
Moving our /etc/bash.bashrc.local to /etc/profile.local does work. Is this the way it was always supposed to be? PATH, PS1, aliases etc in profile.local?
Both bash.bashrc and profile say the same thing to use the respective .local file to "for your local settings, favourite global aliases, VISUAL and EDITOR variables, etc ..."
This will just take a shift of what we have set up. Not too big of a deal. Harder to shift the mentality of the people that originally setup bash.bashrc.local than it is to move it. :)
The global environment variables (like PATH, VISUAL, EDITOR, ...) should go to /etc/profile.local whereas shell functions, shell aliases, shell (environment) variables (like PS1) as well as shell setting/options should be in /etc/bash.bashrc.local -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com