Thomas Waldmann  committed 3e6388a Draft - use shell mode, we have trusted input

  • Participants
  • Parent commits b4d9cdb

Comments (0)

Files changed (1)


 from os.path import exists, abspath
 import sys
 import errno
-import subprocess
+from subprocess import call as cmd
 import shutil
 RSYNC = "rsync -avH --numeric-ids --link-dest=%(link_dst)s %(src)s/ %(dst)s/"
 def rsync(src, dst, link_dst):
     """backup contents of src directory into dst directory"""
-    cmd = RSYNC % dict(src=abspath(src),
-                       dst=abspath(dst),
-                       link_dst=abspath(link_dst))
-    rc =
-    return rc
+    return cmd(RSYNC % dict(src=abspath(src),
+                            dst=abspath(dst),
+                            link_dst=abspath(link_dst)),
+               shell=True)
 def dirshift(path, n, token):