From 8030cf5b36e14737d2753ca1508de79dcbec5315 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Wed, 1 May 2019 10:50:28 +0200 Subject: [PATCH] Safer parameter strings for rsync command. Wrap filename in qoutes. --- transatlanticTorrentExpress.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transatlanticTorrentExpress.py b/transatlanticTorrentExpress.py index 4942872..2fc67d5 100755 --- a/transatlanticTorrentExpress.py +++ b/transatlanticTorrentExpress.py @@ -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)