Hi Alex,
On Tue, Dec 11, 2012 at 7:29 AM, phundisk <
alex.f...@currensee.com> wrote:
> So I just tried to run as local system and administrator, no difference in
> terms of the permissions it created from looking at icalc.
>
> I did a small modification to my class to see if it would help my issues.
> Below I have a very detailed description of everything that is going on.
>
> file { "C:\\MT4+EA-Farm":
> ensure => 'directory',
> owner => "EaFarmGroup",
> mode => '0777',
> recurse => true,
> }
>
> c:\mt4+ea-farm - permissions look good here, eafarmgroup has the "full"
> permissions.
> c:\mt4+ea-farm\assigned - permissions look good here, eafarmgroup has "full"
>
When puppet creates the directory, it creates CREATOR_OWNER and
CREATOR_GROUP access control entries which are inherited by dir/files
created within the parent directory. For example, if I create the
directory using puppet:
C:\work\puppet>envpuppet puppet resource file c:/mydir
ensure=directory owner=Administrators mode=0777
notice: /File[c:/mydir]/ensure: created
file { 'c:/mydir':
ensure => 'directory',
mode => '777',
owner => 'S-1-5-32-544',
}
And then dump the ACL:
C:\work\puppet>icacls c:\mydir
c:\mydir BUILTIN\Administrators:(F)
BIZARRO\Domain Users:(RX,W,DC)
Everyone:(RX,W,DC)
CREATOR OWNER:(CI)(IO)(F)
CREATOR GROUP:(CI)(IO)(RX,W,DC)
CREATOR OWNER:(OI)(IO)(R,W,D,WDAC,WO,DC)
CREATOR GROUP:(OI)(IO)(R,W,DC)
In my case, I'm running as Administrator, and my default group is
"Domain Users". Notice that puppet also creates IO (inherit only)
access control entries for CREATOR_OWNER & GROUP. There is one set for
subdirectories (CI => container inherit) and one set of files (OI =>
object inherit). These are special access control entries in that
those permissions are applied to objects created within the parent
directory based on the DACL specified at creation time. If none is
specified, e.g. NULL security descriptor is passed to CreateFile, then
it applies the creator's default DACL, which varies based on the user,
version of windows, etc.
> This process was launched from user1 who is in the eafarmgroup
> c:\mt4+ea-farm\assigned\folder1 - For this directory, I see some weird
> permissions and I think this is where the root of my puppet/windows issues
> occur. I see the 'user1' has "full" permissions, and that the group 'none'
> was added with rx,w,dc.
The default DACL for user1 is likely None. When user1 creates folder1,
the following inherit only access control entries from the parent
directory are applied to it:
CREATOR OWNER:(CI)(IO)(F)
CREATOR GROUP:(CI)(IO)(RX,W,DC)
> If i re-rerun puppet though, these issues will be
> fixed due to the recurse parameter. I am thinking, it might make sense to
> set in puppet, ensure => directory, and just have setting the permissions be
> a manual step, though I hate doing things manually.
Since you didn't specify a group in your puppet manifest, puppet is
likely removing the access control entry that granted (RX,W,DC) to
None.
>
> Any thoughts on this?
You could specify "group => none" in your manifest so that the
permissions converge without requiring another puppet run. But that
only works if the default DACL for all of your users is None, and it
may not be.
Instead, I would set the permissions on the directory, specifying the
owner, group and mode, but don't recurse. Any dir/file created later,
not by puppet, will have permissions based on the default DACL of the
user that created it, plus whatever inherited access control entries
from the puppet-managed directory.
Note that the None group cannot contain any members, so no one can get
access to folder1 based on the None access control entry.
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/puppet-users/-/6qGKBZoubFcJ.
Josh