saltstack/salt — pull request #1749 by johnthedebs (2012-08-02 01:57:47+00:00)
Title: Fix 'user' setting for cmd.script state

The cmd.script state didn't respect specifying a 'user' to run the script as (kept getting https://gist.github.com/3c1174bc0971db3333c0).

Using python's tempfile.mkstemp would probably make this impossible (based on my understand of what the docs say) so I switched to just using 'open'. It's less secure, but I think that's necessary to accomplish this.