saltstack/salt — pull request #1698 by imankulov (2012-07-26 16:33:03+00:00)
Title: Fix the escaping issue in cmd.run

It seems that cmd.run with runas option didn't escape quotes in command, which could lead to incorrect behavior in some cases. In fact, the fix is trivial, but I'm not 100% sure that it doesn't break the backward compatibility for somebody (maybe someone has already "fixed" it for himself, by adding some extra escape symbols in commands.)

Additionally, to test the change, I slightly improved the testing environment by adding a "mockbin" directory into it. The idea is that while running tests, the system must search commands in this directory first. To make it happen, the patched version of $PATH environment variable is used during the course of testing.

Please consider reviewing, criticizing and, it everything is OK, pulling the changeset. Thank you.