Issue #19727 has been updated by Josh Cooper.

Status changed from Unreviewed to Accepted

Ticket #6091 allowed double leading slashes to be collapsed into a single slash 
in 2.6.5. See also 
<https://groups.google.com/forum/?fromgroups=#!topic/puppet-dev/PU8E6lBa6jU>

This behavior was changed in 2.7.20 in commit 
[912ed346](https://github.com/puppetlabs/puppet/commit/912ed3468b0a20ac66454c1c2b2984fc692ebe70)
 to reduce the memory footprint associated with Puppet::FileCollection. So 
double leading slashes are now preserved. While POSIX says, " A pathname that 
begins with two successive slashes may be interpreted in an 
implementation-defined manner, although more than two leading slashes shall be 
treated as a single slash." 
<http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11>,
 a change such as this should not have been made in a patch release.
----------------------------------------
Bug #19727: Duplicate file resource detection/path validation weirdness with 
multiple slashes in paths
https://projects.puppetlabs.com/issues/19727#change-87028

Author: Ken Johnson
Status: Accepted
Priority: Normal
Assignee: 
Category: file
Target version: 
Affected Puppet version: 2.7.20
Keywords: 
Branch: 


This was reported by one of our commercial users.

It looks like somewhere between version 2.7.6 and 2.7.20 the validation of file 
resource paths was changed in a way that breaks detection of duplicate 
resources. The user tested (and I was able to duplicate their results) 
application of the following resources to systems running Puppet 2.7.6 and 
2.7.20:

<pre>
file { '/tmp/test':
    ensure => directory,
    owner  => root,
    group  => root,
    mode   => '0755'
}
file { '//tmp/test':
    ensure => file,
    owner  => nobody,
    group  => nobody,
    mode   => '0644'
}
</pre>

Under 2.7.6 Puppet detects a collision between the two resources. Under 2.7.20 
it treats them as two separate resources. Given the two paths are generally 
functionally identical I'm thinking the earlier version's behavior is more 
correct and the change may have been unintentional.

<pre>
[root@localhost puppet-2.7.6]# facter -p | grep ver
facterversion => 1.6.7
kernelmajversion => 2.6
kernelversion => 2.6.18
puppetversion => 2.7.6
rubyversion => 1.9.2
selinux_policyversion => 21

[root@localhost puppet-2.7.6]# puppet apply -v ./test.pp 
Cannot alias File[//tmp/test] to ["/tmp/test"] at 
/root/puppet-2.7.6/test.pp:12; resource ["File", "/tmp/test"] already defined 
at /root/puppet-2.7.6/test.pp:6
</pre>

<pre>
[root@localhost puppet-2.7.20]# facter -p | grep ver
facterversion => 1.6.7
kernelmajversion => 2.6
kernelversion => 2.6.18
puppetversion => 2.7.20
rubyversion => 1.9.2
selinux_policyversion => 21

[root@localhost puppet-2.7.20]# puppet apply -v ./test.pp 
info: Applying configuration version '1363130541'
info: /Stage[main]//File[//tmp/test]: Recursively backing up to filebucket
notice: /Stage[main]//File[//tmp/test]: Not removing directory; use 'force' to 
override
info: /Stage[main]//File[//tmp/test]: Recursively backing up to filebucket
notice: /Stage[main]//File[//tmp/test]: Not removing directory; use 'force' to 
override
err: /Stage[main]//File[//tmp/test]/ensure: change from directory to file 
failed: Could not set 'file on ensure: Is a directory - //tmp/test at 
/root/puppet-2.7.20/test.pp:12
notice: Finished catalog run in 0.02 seconds
err: /File[/var/lib/puppet/rrd]: Could not evaluate: Could not find group puppet
err: Could not send report: Got 1 failure(s) while initializing: Could not 
evaluate: Could not find group puppet
</pre>


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to