Keep $HOME from being interpretted by Master shell

The command is being sent to a shelled ssh call which allows $HOME to get interpreted by the local shell. This is usually different than the remote user when using sudo (ie, /root vs /home/user) and causes it to fail to find the shim script.

Should fix bugs: https://github.com/saltstack/salt/issues/25134 and https://github.com/saltstack/salt/issues/24863
This commit is contained in:
vr-jack 2015-08-13 12:52:41 -05:00
parent 65ab5aa495
commit 1fd6fc6ce3

View File

@ -926,10 +926,10 @@ ARGS = {9}\n'''.format(self.minion_config,
pass
# Execute shim
ret = self.shell.exec_cmd('/bin/sh $HOME/{0}'.format(target_shim_file))
ret = self.shell.exec_cmd('/bin/sh \'$HOME/{0}\''.format(target_shim_file))
# Remove shim from target system
self.shell.exec_cmd('rm $HOME/{0}'.format(target_shim_file))
self.shell.exec_cmd('rm \'$HOME/{0}\''.format(target_shim_file))
return ret