Issue #17994 has been updated by Josh Cooper.

Target version set to 3.1.0
Affected Puppet version changed from 2.7.19 to 2.7.10

This issue has been present since 2.7.10 when support for symbolic modes was 
added in commit 24f2a65. We'll fix this in 3.1.0. To work around the problem, 
change `u=rwx,go=x` to `711`
----------------------------------------
Bug #17994: Symbolic file modes when creating directories: Wrong permissions
https://projects.puppetlabs.com/issues/17994#change-79223

Author: Daniel Grafe
Status: In Topic Branch Pending Review
Priority: Normal
Assignee: Henrik Lindberg
Category: 
Target version: 3.1.0
Affected Puppet version: 2.7.10
Keywords: 
Branch: https://github.com/puppetlabs/puppet/pull/1321


Using symbolic modes when creating directories gives an additional sticky bit 
on the directory:

testcase:
<pre>
file { "/tmp/testdir":
  ensure => directory,
  mode   => "u=rwx,go=x"
}
</pre>


Result:
<pre>
> rm -rf /tmp/testdir/
> puppet /tmp/symbolic_mode_test.pp 
warning: Implicit invocation of 'puppet apply' by passing files (or flags) 
directly
to 'puppet' is deprecated, and will be removed in the 2.8 series.  Please
invoke 'puppet apply' directly in the future.

notice: /Stage[main]//File[/tmp/testdir]/ensure: created
notice: Finished catalog run in 0.50 seconds
> ls -la /tmp/ | grep testdir
drwx-----T   2 root     root     4096  6. Dez 09:36 testdir

</pre>


The method for converting symbolic file modes to octals is expecting an octal 
as second parameter. But when creating directories a numeric with base 10 is 
passed. Prefixing this value with a '0' specifying an octal would fix the bug.

In lib/puppet/type/file/ensure.pp:
<pre>
 Dir.mkdir(@resource[:path], symbolic_mode_to_int(mode, 755, true))
                                                         ^
                                                         |- changing to 0755 
will fix the problem
</pre>

I'm filing this against 2.7.19. But since the relevant code has not been 
changed the reported bug should also be reproducable on 3.x


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