Issue #4288 has been updated by Paul Berry.
Status changed from Accepted to Rejected
Assignee deleted (Paul Berry)
I've been investigating this bug, and I see the same behavior in 2.6.x, 0.25.x,
and 0.24.x.
In 2.6.x:
<pre>
'if [ "abc" != "def" ]; then echo "this is a test"; fi' is both unqualifed and
specified no search path at
/Users/pberry/puppet_labs/notes/tests/bug4288/init.pp:4
</pre>
In 0.25.x:
<pre>
'if [ "abc" != "def" ]; then echo "this is a test"; fi' is both unqualifed and
specified no search path at
/Users/pberry/puppet_labs/notes/tests/bug4288/init.pp:4
</pre>
In 0.24.x:
<pre>
err: Could not create foo: 'if [ "abc" != "def" ]; then echo "this is a test";
fi' is both unqualifed and specified no search path at
/Users/pberry/puppet_labs/notes/tests/bug4288/init.pp:4
'if [ "abc" != "def" ]; then echo "this is a test"; fi' is both unqualifed and
specified no search path at
/Users/pberry/puppet_labs/notes/tests/bug4288/init.pp:4
</pre>
This is with the manifest:
<pre>
exec { 'foo':
command => 'if [ "abc" != "def" ]; then echo "this is a test"; fi',
logoutput => true
}
</pre>
Given that (a) the behavior is consistent across three versions of Puppet, (b)
there is concern that changing the behavior would create security
vulnerabilities, and (c) there's an easy workaround, I'm of the opinion that we
should leave the behavior as is.
----------------------------------------
Bug #4288: Error if exec command starts with shell built-in like "if"
http://projects.puppetlabs.com/issues/4288
Author: Alan Harder
Status: Rejected
Priority: Normal
Assignee:
Category: exec
Target version:
Affected version: 2.6.0
Keywords:
Branch:
<pre>exec { 'foo':
command => 'if [ "abc" != "def" ]; then echo "this is a test"; fi',
logoutput => true
}</pre>
With the above test case on 2.6.0rc4 (on Solaris 10 with ruby 1.8.7) I get:
<pre>err: /Stage[main]//Node[...]/Exec[foo]/returns: change from notrun to 0
failed: Could not find executable 'no if in /usr/bin /usr/sbin'</pre>
A command like this worked in 0.25.5.. is the behavior change intentional, or
is this a bug?
Side node: if I add whitespace at the front (command => ' if [ .....') then the
error says *Could not find command ''*
--
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://projects.puppetlabs.com/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.