Bug #15213
puppet resource file /etc/sudoers output contains 3 octal mode instead of 4
| Status: | Investigating | Start date: | 06/25/2012 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% | |
| Category: | - | |||
| Target version: | - | |||
| Affected Puppet version: | Branch: | |||
| Keywords: | ||||
Description
[root@training manifests]# puppet resource file /etc/sudoers file { ‘/etc/sudoers’: ensure => ‘file’, content => ‘{md5}f298d1064df9009a1603d76ed90ed90f’, ctime => ‘Mon Jun 25 13:39:50 +0000 2012’, group => ‘0’, mode => ‘440’, mtime => ‘Mon Jun 25 13:39:50 +0000 2012’, owner => ‘0’, type => ‘file’, }
History
#1
Updated by Matthaus Owens 12 months ago
- Project changed from Puppet Enterprise (Public) to Puppet
I’m moving this to core puppet because this is not specific to Puppet Enterprise.
Additionally, I’ll toss in a wikipedia quote:
Octal notation
Another common method for representing Unix permissions is octal notation. Octal notation consists of a three- or four-digit base-8 value.
With three-digit octal notation, each numeral represents a different component of the permission set: user class, group class, and "others" class respectively.
So returning a 3 digit octal is perfectly acceptable, and has an implicit leading 0.
#2
Updated by Eric Shamow 12 months ago
- Status changed from Unreviewed to Investigating
Haus,
True re Wikipedia, but from the Style Guide:
File modes should be represented as 4 digits rather than 3, to explicitly show that they are octal values.
And we advise people to do so to ensure they aren’t messing around with suid/setgid bits as well. The code coming out of puppet resource should be able to pass puppet-lint :)
-Eric