[Bug 1219979] New: Bash exported function are renamed internally then are ignored by Systemd - Kde desktop
https://bugzilla.suse.com/show_bug.cgi?id=1219979 Bug ID: 1219979 Summary: Bash exported function are renamed internally then are ignored by Systemd - Kde desktop Classification: openSUSE Product: openSUSE Distribution Version: Leap 15.5 Hardware: x86-64 OS: openSUSE Leap 15.5 Status: NEW Severity: Critical Priority: P5 - None Component: Basesystem Assignee: screening-team-bugs@suse.de Reporter: jcdole@free.fr QA Contact: qa-bugs@suse.de Target Milestone: --- Found By: --- Blocker: --- I have bash definition functions and variables that are sourced from /etc/profile.d (case 1) or from ~/.profile (case 2) In case 1, journald show : Feb 15 17:13:55 15-4---G731GV-VM-04 startplasma-x11[1725]: Skipping syncing of environment variable "BASH_FUNC__MY_ECHO_%%" as name contains unsupported characters None of my function are exported to user environment. None of my functions use the double characters '%%' I have environment variables that defined colors : MY_LIGHT_RED=$'\e[1;31m' Journald show : Feb 15 17:13:55 15-4---G731GV-VM-04 startplasma-x11[1725]: Skipping syncing of environment variable "MY_LIGHT_RED" as value contains unsupported characters These colors definition are not exported to user environment. In case 2, journald show the same errors but in this case functions and env var are exported to the user environment. Any help is very welcome. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c1
Dirk Weber
https://bugzilla.suse.com/show_bug.cgi?id=1219979
Vadim Krevs
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c3
--- Comment #3 from Jean-Claude Dole
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c4
--- Comment #4 from Dirk Weber
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c5
--- Comment #5 from Jean-Claude Dole
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c6
--- Comment #6 from Dr. Werner Fink
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c7
Dr. Werner Fink
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c8
--- Comment #8 from Jean-Claude Dole
Just created on TW (should also work on Leap) a file
localhost:~/Desktop # cat /etc/profile.d/testt.sh function xyz () { true } export -f xyz export testt=testt localhost:~/Desktop #
then log out and log in again open a konsole and see
localhost:~/Desktop # printenv | grep testt testt=testt localhost:~/Desktop # printenv | grep xyz BASH_FUNC_xyz%%=() { true
and it works
localhost:~/Desktop # set -x; xyz ; set +x + xyz + true + set +x
it should be noted that I use the display-manager.service on that TW
That does not work on a fresh install of leap 15.5 nor leap 15.6 Apr 11 18:57:40 localhost.localdomain startplasma-x11[1537]: org.kde.plasma.libkworkspace: Skipping syncing of environment variable "BASH_FUNC_stop_or_continue%%" as name contains unsupported characters Remark : None of my functions have a %% in their name. ------------------------------------------------------- Same kind error for environment variables : Apr 11 18:57:40 localhost.localdomain startplasma-x11[1537]: org.kde.plasma.libkworkspace: Skipping syncing of environment variable "MY_LIGHT_CYAN" as value contains unsupported characters MY_LIGHT_CYAN is defined like this MY_LIGHT_CYAN=$'\e[1;36m' or defined like this MY_LIGHT_CYAN=$'\e[1;36m' -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c9
--- Comment #9 from Jean-Claude Dole
Exporting functions is a bash special feature* and not supported by any other shell or program like systemd and as all exported variables this belongs to /etc/profile, /etc/profile.local, and /etc/profile.d/*.sh
Can we please stop misusing ~/.bashrc, /etc/bash.bashrc, and /etc/bash.bashrc.local for environment? Those are for interacive invocation only. As the the profile is sourced at login via e.g. (/usr)/etc/X11/xdm/Xsession in the exec_login() function to have the environmnet only once for the full login session.
* werner@boole:~> xyz() { true; } werner@boole:~> export -f xyz werner@boole:~> printenv | grep xyz printenv | grep -A1 xyz BASH_FUNC_xyz%%=() { true }
only bash knows about `export -f' and `BASH_FUNC_*%%=()' but not systemd
Following your comment I sourced my files definitions in : /etc/profile.d/*.sh --> that does not work /etc/profile.local/*.sh --> that does not work In each case same error : Apr 11 18:57:40 localhost.localdomain startplasma-x11[1537]: org.kde.plasma.libkworkspace: Skipping syncing of environment variable "BASH_FUNC_stop_or_continue%%" as name contains unsupported characters Apr 11 18:57:40 localhost.localdomain startplasma-x11[1537]: org.kde.plasma.libkworkspace: Skipping syncing of environment variable "MY_LIGHT_CYAN" as value contains unsupported characters -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c10
--- Comment #10 from Jean-Claude Dole
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c11
Dr. Werner Fink
That does not work on a fresh install of leap 15.5 nor leap 15.6 Apr 11 18:57:40 localhost.localdomain startplasma-x11[1537]: org.kde.plasma.libkworkspace: Skipping syncing of environment variable "BASH_FUNC_stop_or_continue%%" as name contains unsupported characters
Remark : None of my functions have a %% in their name.
Yep ... this what bash does to detect exported function names and this is nonnegotiable as a security feature. And this is what export -f <function> does, it prefixes any exported function with BASH_FUNC_ and also suffixes it with `%%' ... see https://unix.stackexchange.com/questions/609739/bash-exported-function-not-v...
Same kind error for environment variables :
Apr 11 18:57:40 localhost.localdomain startplasma-x11[1537]: org.kde.plasma.libkworkspace: Skipping syncing of environment variable "MY_LIGHT_CYAN" as value contains unsupported characters
MY_LIGHT_CYAN is defined like this MY_LIGHT_CYAN=$'\e[1;36m' or defined like this MY_LIGHT_CYAN=$'\e[1;36m'
That is an other building yard, means not bash. As I'm using systemd but not KDE not GNOME as desktop the subject of this bug seems to be misleading one. This is not a bug of systemd nor of bash. But it could be that this is a security feature to protect against malicious escape sequences in variables names as well as variable values. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c12
--- Comment #12 from Dr. Werner Fink
(In reply to Jean-Claude Dole from comment #8)
That does not work on a fresh install of leap 15.5 nor leap 15.6 Apr 11 18:57:40 localhost.localdomain startplasma-x11[1537]: org.kde.plasma.libkworkspace: Skipping syncing of environment variable "BASH_FUNC_stop_or_continue%%" as name contains unsupported characters
Remark : None of my functions have a %% in their name.
Yep ... this what bash does to detect exported function names and this is nonnegotiable as a security feature.
https://en.wikipedia.org/wiki/Shellshock_(software_bug) -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c13
--- Comment #13 from Dr. Werner Fink
I would like to point out that you did not answer my question: "What changes Opensuse have made after version leap 15.4"
On the other hand, in your remarks you refer to systemd. What systemd has to do with the Bash program.
Regards
Guess ... new plasma workspace version with tighten security filters in the environment handling, but this is a guess. As I'm sill using fvwm (+ lxsession + xfce4-panel) I do not face this problem. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c14
--- Comment #14 from Dirk Weber
(In reply to Jean-Claude Dole from comment #10)
I would like to point out that you did not answer my question: "What changes Opensuse have made after version leap 15.4"
On the other hand, in your remarks you refer to systemd. What systemd has to do with the Bash program.
Regards
Guess ... new plasma workspace version with tighten security filters in the environment handling, but this is a guess. As I'm sill using fvwm (+ lxsession + xfce4-panel) I do not face this problem.
What has changed in Leap 15.5 is how the plasma session is started ("systemdBoot" instead of kdeinit5), see bug 1203617 comment 53. With this change together with the Shellshock counter measure setting bash functions in the profile becomes useless for interactive sessions. Or you call the functions by their Shellshock protected names... -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c16
--- Comment #16 from Jean-Claude Dole
Resetting severity - this is not critical by any means.
(In reply to Dirk Weber from comment #1)
Just for information: this is basically the same problem as described by bug 1203617.
Short summary: such functions should not be defined in the profile (/etc/profile.d or ~/.profile ) but in bashrc (/etc/bash.bashrc.local, ~/.bashrc) which are intended for interactive shells.
In your case with local adaptations you can just move the definitions there.
^
IMO RESOLVED INVALID or WONTFIX.
That "%" is not a valid environment variable for "dbus-update-activation-environment --systemd" is a systemd topic: https://github.com/systemd/systemd/pull/25235
Stop that. I am not using any "%" in name. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c17
--- Comment #17 from Jean-Claude Dole
(In reply to Jean-Claude Dole from comment #8)
That does not work on a fresh install of leap 15.5 nor leap 15.6 Apr 11 18:57:40 localhost.localdomain startplasma-x11[1537]: org.kde.plasma.libkworkspace: Skipping syncing of environment variable "BASH_FUNC_stop_or_continue%%" as name contains unsupported characters
Remark : None of my functions have a %% in their name.
Yep ... this what bash does to detect exported function names and this is nonnegotiable as a security feature. And this is what
export -f <function>
does, it prefixes any exported function with BASH_FUNC_ and also suffixes it with `%%' ... see
https://unix.stackexchange.com/questions/609739/bash-exported-function-not- visible-but-variables-are
Same kind error for environment variables :
Apr 11 18:57:40 localhost.localdomain startplasma-x11[1537]: org.kde.plasma.libkworkspace: Skipping syncing of environment variable "MY_LIGHT_CYAN" as value contains unsupported characters
MY_LIGHT_CYAN is defined like this MY_LIGHT_CYAN=$'\e[1;36m' or defined like this MY_LIGHT_CYAN=$'\e[1;36m'
That is an other building yard, means not bash. As I'm using systemd but not KDE not GNOME as desktop the subject of this bug seems to be misleading one.
This is not a bug of systemd nor of bash.
But it could be that this is a security feature to protect against malicious escape sequences in variables names as well as variable values.
If I understand well, don't use bash or don't use systemd or don't use Opensuse. Or give a real solution to people that run into problems because Opensuse decides to change their mind. Just tell me how can I define an environment variable for some colors ? Just tell me how can I defined bash functions that are not available in the binaries. That should not be very difficult for Opensuse guru. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c18
--- Comment #18 from Jean-Claude Dole
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c19
--- Comment #19 from Dr. Werner Fink
https://bugzilla.suse.com/show_bug.cgi?id=1219979
Dr. Werner Fink
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c20
--- Comment #20 from Dr. Werner Fink
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c21
--- Comment #21 from Dr. Werner Fink
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c22
--- Comment #22 from Jean-Claude Dole
Created attachment 874405 [details] bash.bashrc.local and profile.local ... ... ...
To put it simply I decided one day to make a list of variables that I used often. With this list I was sure to always use the same name for the same object. I applied the same principle for functions that I often used; which prevented me from reinventing the wheel. On the other hand, I decided not to differentiate between different types of bash sessions; so I only have two definition files, one for variables and one for functions. To continue in simplicity I decided to make this organization available as soon as linux is powered on even before the user is logged in. I have made some test with other distributions on VBOX virtual machine. Some distro ignore my function definitions without errors if sourced in /etc/profile.d. No messages in journald concerning the infamous '%%'. It seems that systemd "clear environment" in that case. Messages sent to logger show that function definitions has been sourced without errors but does not survive. Regarding Leap 15.5, putting stuff in /etc.bashrc.local and in /etc/profile.local seems to satisfy my need. I just need to make sure that things won’t be sourced more than once. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c23
--- Comment #23 from Jean-Claude Dole
https://bugzilla.suse.com/show_bug.cgi?id=1219979
https://bugzilla.suse.com/show_bug.cgi?id=1219979#c24
--- Comment #24 from Jean-Claude Dole
participants (1)
-
bugzilla_noreply@suse.com