mirror of
https://github.com/KevinMidboe/transatlanticTorrentExpress.git
synced 2025-10-29 18:00:19 +00:00
Safer parameter strings for rsync command. Wrap filename in qoutes.
This commit is contained in:
@@ -9,9 +9,9 @@ from utils import getConfig
|
||||
def getFiles(path, host=None, user=None):
|
||||
logger.info('Getting filenames from path: {}'.format(path))
|
||||
if (host and user):
|
||||
cmd = 'ssh {}@{} ls {}'.format(user, host, path)
|
||||
cmd = "ssh {}@{} ls '{}'".format(user, host, path)
|
||||
else:
|
||||
cmd = 'ls {}'.format(path)
|
||||
cmd = "ls '{}'".format(path)
|
||||
|
||||
contents = check_output(cmd, shell=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user