<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:'times new roman', 'new york', times, serif;font-size:12pt"><div><div>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. </div></div><div><br></div><div><div><div>There was the same issue listed in the archive <a href="http://mail.python.org/pipermail/python-win32/2006-March/004472.html">http://mail.python.org/pipermail/python-win32/2006-March/004472.html</a>, but there was no response.</div></div></div><div><br></div><div>Any ideas what I'm missing?</div><div><br></div><div>Here is the sample code I'm using:</div><div><br></div><div><div>>>> user,domain,type =
win32security.LookupAccountName("","DOMAIN\\username")</div><div>>>> sd = win32security.GetFileSecurity("C:\\testdir",win32security.DACL_SECURITY_INFORMATION)</div><div>>>> dacl = sd.GetSecurityDescriptorDacl()</div><div>>>> dacl.AddAccessAllowedAceEx(win32security.ACL_REVISION_DS,win32security.OBJECT_INHERIT_ACE|win32security.CONTAINER_INHERIT_ACE,win32file.FILE_ALL_ACCESS,user)</div><div>>>> sd.SetSecurityDescriptorDacl(1,dacl,0)</div><div>>>> win32security.SetFileSecurity("C:\\testdir",win32security.DACL_SECURITY_INFORMATION,sd)</div></div><div><br></div><div>Thanks!</div><div style="position:fixed"></div>
</div></body></html>