mirror of
https://github.com/containers/podman.git
synced 2026-11-08 17:12:52 -05:00
Problem: When image scp transfers an image between local users, the save, load, and tag subprocesses inherit the caller's working directory. Running the transfer from a directory such as /root can fail because the destination user cannot access that directory during rootless initialization. Fix: Use the caller's physical directory to preserve relative paths and avoid inaccessible symlinks in PWD. Return working-directory lookup errors. If subprocess startup fails with a permission error, retry once from /. Restrict the retry to fork/exec errors so a Podman command that has already started is never executed a second time. For the retry, create a fresh command with the same credentials, environment, and output handling. Tests: Extend the transfer test to use an inaccessible directory. Run its sudo checks from /. Add coverage for relative and absolute configuration paths and missing-image errors. Fixes #24247 Signed-off-by: Garv Changrani <154041471+Garvity@users.noreply.github.com>