From f17e82ce5cd7708bd6d6689057d068e43871e87c Mon Sep 17 00:00:00 2001 From: Axel Kittenberger Date: Thu, 24 Mar 2011 06:42:00 +0000 Subject: [PATCH] escape filenames for mv commands --- lsyncd.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lsyncd.lua b/lsyncd.lua index ed5dc7d..b06aec2 100644 --- a/lsyncd.lua +++ b/lsyncd.lua @@ -1002,7 +1002,7 @@ local Excludes = (function() -- local function toLuaPattern(p) local o = p - p = string.gsub(p, "%%", "%%") + p = string.gsub(p, "%%", "%%") -- TODO check p = string.gsub(p, "%^", "%%^") p = string.gsub(p, "%$", "%%$") p = string.gsub(p, "%(", "%%(") @@ -3245,9 +3245,10 @@ local default_rsyncssh = { log("Normal", "Moving ",event.path," -> ",event2.path) spawn(event, "/usr/bin/ssh", config.host, "mv", - config.targetdir .. event.path, - config.targetdir .. event2.path, - "||", "rm", "-rf", config.targetdir .. event.path) + '\"' .. config.targetdir .. event.path .. '\"', + '\"' .. config.targetdir .. event2.path .. '\"', + "||", "rm", "-rf", + '\"' .. config.targetdir .. event.path .. '\"') return end