The permissions are applied to the directory but subdirectories and files
within
the directory aren't inheriting the permissions. I can manually go the
Advanced
Security Settings for the directory and check "Apply these permissions to
objects and/or container within this container only" to get the desired result.
There was the same issue listed in the
archive http://mail.python.org/pipermail/python-win32/2006-March/004472.html,
but there was no response.
Any ideas what I'm missing?
Here is the sample code I'm using:
>>> user,domain,type = win32security.LookupAccountName("","DOMAIN\\username")
>>> sd =
>>>win32security.GetFileSecurity("C:\\testdir",win32security.DACL_SECURITY_INFORMATION)
>>>
>>> dacl = sd.GetSecurityDescriptorDacl()
>>> dacl.AddAccessAllowedAceEx(win32security.ACL_REVISION_DS,win32security.OBJECT_INHERIT_ACE|win32security.CONTAINER_INHERIT_ACE,win32file.FILE_ALL_ACCESS,user)
>>>
>>> sd.SetSecurityDescriptorDacl(1,dacl,0)
>>> win32security.SetFileSecurity("C:\\testdir",win32security.DACL_SECURITY_INFORMATION,sd)
>>>
Thanks!
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32