Issue #7217 has been updated by Ben Hughes.

>From looking at the code, that cheeky change would break loading of templates 
>from other template_paths, so modules then.

I think we're cleverly using File.expand_path as a way of checking that we're 
giving a full path, but then we lose the ability to remove multiple '/'s or do 
crazy things like "/usr/local/../../opt/something". Some could argue this is a 
just and noble thing.

We could do something like band-aid it with a:

<pre>
template.gsub!( %r_/{2,}_ , "/" )
</pre>

but icky, wrong (and POSIX filesystems only).
----------------------------------------
Bug #7217: double slashes error in template path
https://projects.puppetlabs.com/issues/7217

Author: stéphane travassac
Status: Unreviewed
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 2.6.7
Keywords: 
Branch: 


hello,<br>
When I include a template (content => template)  with double slashes in his 
path, Puppet cause an error

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could 
not find template 
'/etc/puppet/manifests/rs4repo/files/config**//**adm/dev/deploy/hosts.debian.tpl'
 at /etc/puppet/manifests/rs4repo/classes/common/hosts.pp:18 on node 
XXXXXXXXXXXXX

I can fix the problem by changing the line: <br> 
if template == File.expand_path(template) <br> 
by <br> 
if template = File.expand_path(template) <br> 

in file /usr/lib/ruby/1.8/puppet/parser/files.rb (line 37)<br>
Is template path must have only single slash ? if false this fix looks good ?



-- 
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.

Reply via email to