mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
added check for starting $HOME for remote_tmp so as to non root sudo override
Signed-off-by: Brian Coca <bcoca@tablethotels.com>
This commit is contained in:
@@ -573,7 +573,7 @@ class Runner(object):
|
|||||||
|
|
||||||
basefile = 'ansible-%s-%s' % (time.time(), random.randint(0, 2**48))
|
basefile = 'ansible-%s-%s' % (time.time(), random.randint(0, 2**48))
|
||||||
basetmp = os.path.join(C.DEFAULT_REMOTE_TMP, basefile)
|
basetmp = os.path.join(C.DEFAULT_REMOTE_TMP, basefile)
|
||||||
if self.sudo and self.sudo_user != 'root':
|
if self.sudo and self.sudo_user != 'root' and basetmp.startswith('$HOME'):
|
||||||
basetmp = os.path.join('/tmp', basefile)
|
basetmp = os.path.join('/tmp', basefile)
|
||||||
|
|
||||||
cmd = 'mkdir -p %s' % basetmp
|
cmd = 'mkdir -p %s' % basetmp
|
||||||
|
|||||||
Reference in New Issue
Block a user