Issue #2492 has been reported by Thomas Bellman.

----------------------------------------
Feature #2492: Function for quoting shell words wanted
http://projects.reductivelabs.com/issues/2492

Author: Thomas Bellman
Status: Needs design decision
Priority: Normal
Assigned to: Thomas Bellman
Category: functions
Target version: 0.25.0
Complexity: Easy
Affected version: 0.25.0rc1
Keywords: 


Constructing shell commands to use in the exec type can be
fraught with danger, especially if some of the parts come from
"external" sources (for example, parameters to a definition) and
can contain shell metacharacters.  Having a function that quotes
its arguments so they are safe to pass into a shell command would
be nice to have.

Usage would be something like this:

<pre>
    define my_define($file, ...)
    {
        $cmd = sprintf("cmd1 %s | cmd2", shellquote($file))
        exec {
            "my_define--$name":
                command => $cmd;
        }
    }

    my_define {
        "test": file => "/home/bellman/My Documents", ...;
    }
</pre>

I have an implementation ready that I will post for review.



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to