Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated "docker" script has faulty variable substitution #24924

Open
siretart opened this issue Jan 2, 2025 · 1 comment
Open

Generated "docker" script has faulty variable substitution #24924

siretart opened this issue Jan 2, 2025 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@siretart
Copy link
Contributor

siretart commented Jan 2, 2025

Issue Description

the generated docker script interpolates the variable $HOME when it should not

Steps to reproduce the issue

ETCDIR=/etc BINDIR=/bin envsubst < docker.in 

Describe the results you received

#!/bin/sh
[ -e /etc/containers/nodocker ] || [ -e "\${XDG_CONFIG_HOME-\/home/siretart/.config}/containers/nodocker" ] || \
echo "Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg." >&2
exec /bin/podman "$@"

Describe the results you expected

#!/bin/sh
[ -e /etc/containers/nodocker ] || [ -e "${XDG_CONFIG_HOME-${HOME}/.config}/containers/nodocker" ] || \
echo "Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg." >&2
exec /bin/podman "$@"

podman info output

not necessary

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

not necessary

Additional information

this is actually the only issue found that makes the debian package fail the reproducibilty test: https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/podman.html

All other bits and pieces of podman are bit-for-bit reproducible! great work! :-)

@siretart siretart added the kind/bug Categorizes issue or PR as related to a bug. label Jan 2, 2025
@afbjorklund
Copy link
Contributor

afbjorklund commented Jan 2, 2025

It is the same in Fedora package. But you probably don't get far without $XDG_CONFIG_HOME anyway?

#!/usr/bin/sh
[ -e /etc/containers/nodocker ] || [ -e "\${XDG_CONFIG_HOME-\/builddir/.config}/containers/nodocker" ] || \
echo "Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg." >&2
exec /usr/bin/podman "$@"

EDIT: The dollar is actually escaped, so it is broken there too... (Only the /etc/containers/nodocker works)

https://koji.fedoraproject.org/koji/buildinfo?buildID=2596372

@siretart siretart changed the title Generated "docker" script has fault substitution Generated "docker" script has faulty substitution Jan 2, 2025
@siretart siretart changed the title Generated "docker" script has faulty substitution Generated "docker" script has faulty variable substitution Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants