Skip to content

Instantly share code, notes, and snippets.

@ferventcoder
Created March 31, 2014 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ferventcoder/9902007 to your computer and use it in GitHub Desktop.
Save ferventcoder/9902007 to your computer and use it in GitHub Desktop.
Mode versus ACL - the two are mostly incompatible with each other.
file { 'c:/tempperms/mode':
ensure => directory,
mode => 0770,
owner => 'rob',
group => 'Administrators',
}
# this is fun
# acl {'c:/tempperms/mode':
# ensure => present,
# #purge => true,
# permissions => [
# { identity => 'Administrator', rights => ['modify'] },
# { identity => 'rob', rights => ['full'] }
# ],
# inherit_parent_permissions => false,
# #owner => 'Administrators',
# require => File['c:/tempperms/mode'],
# }
# this is in "sync" with the mode above, but you cannot add or
# remove from it without convergence thrashing
acl { 'c:\tempperms\mode':
ensure => present,
purge => true,
group => 'S-1-5-32-544',
inherit_parent_permissions => false,
owner => 'rob',
permissions => [
{ identity => 'rob', rights => ["full"], affects => 'self_only' },
{ identity => 'BUILTIN\Administrators', rights => ["mask_specific"], mask => '1180159', affects => 'self_only' },
{ identity => 'Everyone', rights => ["mask_specific"], mask => '1179776', affects => 'self_only' },
{ identity => 'SYSTEM', rights => ["full"], affects => 'self_only' },
{ identity => 'CREATOR OWNER', rights => ["full"], child_types => 'containers', affects => 'children_only' },
{ identity => 'CREATOR GROUP', rights => ["mask_specific"], mask => '1180159', child_types => 'containers', affects => 'children_only' },
{ identity => 'CREATOR OWNER', rights => ["mask_specific"], mask => '2032095', child_types => 'objects', affects => 'children_only' },
{ identity => 'CREATOR GROUP', rights => ["mask_specific"], mask => '1180127', child_types => 'objects', affects => 'children_only' }
],
}
@ferventcoder
Copy link
Author

The most important thing to note here is that when you attempt to add anything to this set, it will start the resource thrashing in reports. So having the two together defeats the purpose. It's something we'd have to backport in addition to the changes with ACLs in 3.4.0.

@joshcooper
Copy link

I think what you want to do, is add a validation method, and ensure there isn't another file resource in the catalog where mode is being managed, or owner/group are different than what is specified in the ACL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment