saltstack/salt — pull request #15124 by ryepup (2014-08-20 21:47:50+00:00)
Title: win: use `subprocess.list2cmdline` to sanitize user input

The `win_services` module uses `string.format` to build commands that
get run on the shell, performing some simple defenses against bad user
input.

Most look like `'net stop "{0}"'.format(name)`, where `name` comes
from user input, using double quotes to permit names containing
spaces.

`subprocess.list2cmdline` solves the escaping problem more robustly.