From 298d64aa1d2af448a967e313e27bdfe7fe7fe048 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Mon, 11 Mar 2013 17:19:43 -0400 Subject: [PATCH] Quote remote md5 operations. Fixes #2368 --- lib/ansible/runner/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index dd237c946ef..f0826c3bdd3 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -546,6 +546,7 @@ class Runner(object): def _remote_md5(self, conn, tmp, path): ''' takes a remote md5sum without requiring python, and returns 0 if no file ''' + path = pipes.quote(path) test = "rc=0; [ -r \"%s\" ] || rc=2; [ -f \"%s\" ] || rc=1; [ -d \"%s\" ] && rc=3" % (path, path, path) md5s = [ "(/usr/bin/md5sum %s 2>/dev/null)" % path, # Linux