[BUG] salt-ssh pre-flight may fail if $TMPDIR is set #58996
Labels
Bug
broken, incorrect, or confusing behavior
Salt-SSH
severity-medium
3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
Milestone
Description
salt-ssh
pre-flight scripts will fail if$TMPDIR
is set and does not exist on the remote host.salt.client.ssh.run_ssh_pre_flight
constructs the remote path for the pre-flight script usingtempfile.gettempdir()
, which will return the value of$TMPDIR
if it's defined. If this directory doesn't exist on the remote host, the script copy will fail.I ran into this on Linux, but users running
salt-ssh
from MacOS are also very likely to hit this bug because MacOS sets a per-user$TMPDIR
under/var/folders
.Setup
Configure
salt-ssh
to use any pre-flight script.Steps to Reproduce the behavior
Debug shows an
scp
to a path constructed from local $TMPDIR:And fails to run at that path because the
scp
actually failed.Expected behavior
salt-ssh
should probably always use/tmp
as the destination path for the pre-flight script.Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)The text was updated successfully, but these errors were encountered: