Merge pull request #38819 from twangboy/salt_perms_2016.11

Remove `Users` from c:\salt [DO NOT MERGE FORWARD]
This commit is contained in:
Mike Place 2017-01-20 13:17:35 -07:00 committed by GitHub
commit 4913c4f90c

View File

@ -215,7 +215,6 @@ def set_path_permissions(path):
'''
# TODO: Need to make this more generic, maybe a win_dacl utility
admins = win32security.ConvertStringSidToSid('S-1-5-32-544')
user = win32security.ConvertStringSidToSid('S-1-5-32-545')
system = win32security.ConvertStringSidToSid('S-1-5-18')
owner = win32security.ConvertStringSidToSid('S-1-3-4')
@ -225,14 +224,10 @@ def set_path_permissions(path):
inheritance = win32security.CONTAINER_INHERIT_ACE |\
win32security.OBJECT_INHERIT_ACE
full_access = ntsecuritycon.GENERIC_ALL
user_access = ntsecuritycon.GENERIC_READ | \
ntsecuritycon.GENERIC_EXECUTE
dacl.AddAccessAllowedAceEx(revision, inheritance, full_access, admins)
dacl.AddAccessAllowedAceEx(revision, inheritance, full_access, system)
dacl.AddAccessAllowedAceEx(revision, inheritance, full_access, owner)
if 'pki' not in path:
dacl.AddAccessAllowedAceEx(revision, inheritance, user_access, user)
try:
win32security.SetNamedSecurityInfo(