From b06edbda0478ed57954d716f64f6870d7ae68f63 Mon Sep 17 00:00:00 2001 From: FĂ©lix Sipma Date: Fri, 28 Apr 2017 00:19:46 +0200 Subject: Restic: fix bug in shell escaping --- src/Propellor/Property/Restic.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Propellor/Property/Restic.hs') diff --git a/src/Propellor/Property/Restic.hs b/src/Propellor/Property/Restic.hs index 668843bb..02b2ead0 100644 --- a/src/Propellor/Property/Restic.hs +++ b/src/Propellor/Property/Restic.hs @@ -149,17 +149,17 @@ backup' dir repo crontimes extraargs kp = cronjob where desc = val repo ++ " restic backup" cronjob = Cron.niceJob ("restic_backup" ++ dir) crontimes (User "root") "/" $ - "flock " ++ shellEscape lockfile ++ " sh -c " ++ backupcmd + "flock " ++ shellEscape lockfile ++ " sh -c " ++ shellEscape backupcmd lockfile = "/var/lock/propellor-restic.lock" - backupcmd = intercalate ";" $ + backupcmd = intercalate " && " $ createCommand : if null kp then [] else [pruneCommand] createCommand = unwords $ [ "restic" , "-r" - , val repo + , shellEscape (val repo) , "--password-file" - , getPasswordFile repo + , shellEscape (getPasswordFile repo) ] ++ map shellEscape extraargs ++ [ "backup" @@ -168,9 +168,9 @@ backup' dir repo crontimes extraargs kp = cronjob pruneCommand = unwords $ [ "restic" , "-r" - , val repo + , shellEscape (val repo) , "--password-file" - , getPasswordFile repo + , shellEscape (getPasswordFile repo) , "forget" , "--prune" ] -- cgit v1.2.3