docker/podman-docker.sh
breaks login shells
#23628
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Issue Description
The latest Podman available in Debian trixie includes a script
docker/podman-docker.sh
which breaks login shells. This is because the script runs for all login shells and checks whether a variable is empty, but the variable may not even be set. This fails if a login shell runs with-eu
(error checking and checking for undefined variables).The fix is to replace the check on line 3 of the script. Instead of
if [ -z "$DOCKER_HOST" ]; then
, the line should be changed toif [ -z "${DOCKER_HOST-''}" ]; then
. This will explicitly set the variable to the empty value if it is unset within the scope of the check.Steps to reproduce the issue
Steps to reproduce the issue on a host system
sudo su -l root -s /bin/sh -- -eu -c 'true' ; echo $?
Describe the results you received
Describe the results you expected
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: