File mode

(PUP-3787) Add leading '0' for four-digit octal notation of file modes.
Would that be necessary? I think mode => '1777' is sufficient based on the
docs. If not, then the docs need some tweaking too.

On Tuesday, December 23, 2014, Kylo Ginsberg <notifications@github.com>
wrote:

> In lib/puppet/provider/file/posix.rb
> <https://github.com/puppetlabs/puppet/pull/3436#discussion-diff-22216907>:
>
> > @@ -118,7 +118,7 @@ def group=(should)
> >
> >    def mode
> >      if stat = resource.stat
> > -      return (stat.mode & 007777).to_s(8)
> > +      return (stat.mode & 007777).to_s(8).rjust(4, '0')
>
> Perhaps extend this to the case where the sticky/etc bits are set, i.e. so
> that we get '01777' rather than '1777'. And add a spec test to catch that
> case, since it's easy to forget :)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/puppetlabs/puppet/pull/3436/files#r22216907>.
>


-- 

Rob Nelson
rnelson0@gmail.com