systemd lsb-base integration script leaking shell variable changes which can break consumers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Expired
|
Wishlist
|
Unassigned |
Bug Description
I am using systemd version 248.3-1ubuntu3 from the impish repository.
It was compiled and built in the following manner:
# add impish deb-src repository to apt sources
apt build-dep systemd/impish
apt source -b systemd/impish
Once built, it was installed over the top of systemd 245.4-4ubuntu3.
I am running ubuntu 20.04.2.
The source tarball of systemd includes a file (./debian/
The problem that I am having is that this file (which is sourced by any script which sources /lib/lsb/
https:/
I noticed this when investigating why ipmiutil_
I think this is systemd's bug because systemd's lsb-base drop-in is not being a "good neighbor" to the scripts with which it shares a controlling shell. Even if ipmiutil were to rewrite its ipmiutil-wdt script, any other such script provided by another package which tries to use a variable called $prog (or $executable, or $argument, or $service, or $state, or any of a handful of others) will find its feet being stepped on by systemd's drop-in.
I propose that the drop-in be modified to encapsulate all of this behavior where variables are assigned to within a function or subshell or something, so they can't accidentally contaminate the outside world.
Other related package versions:
lsb-base: 11.1.0ubuntu2
ipmiutil: 3.1.5-1
I'm not a bash script architect, but I bodged together this workaround and the ipmiutil_wdt service starts correctly with it applied to my system:
https:/ /gist.github. com/TheWug/ 1a7f509e040f10c 05039acc06fe29d 9e