Dennis Feiock wrote:

> Hi all,
> 
> I have been trying to write a script to backup/restore NTFS permissions.
> I have come across one problem.
> 
> How can I set a folder to inherit its permissions?  I am able to detect
> if a folder has inherited permissions by:
> 
> 16 & ACE_FLAGS == 16
> 
> When I am stepping through them and exporting to an XML file.
> 
> I found this message:
> 
> http://mail.python.org/pipermail/python-win32/2004-July/002112.html
> 
> Which states that ACEs have to be in a certain order (inherited ACEs
> last).

ACEs are automatically reordered when they're added.

> I am able to use the win32security.SetFileSecurity function correctly to
> set permissions.  It's just that when I go to view the inheritance on
> the folder, the checkbox is always unchecked.


When building the ACL yourself,  you'll need to use
AddAccessAllowedAceEx and AddAccessDeniedAceEx
to be able to specify the inheritance flags.
Also, see this thread:
http://mail.python.org/pipermail/python-win32/2006-February/004210.html
for a discussion on storing permissions for later restoral.

     hth
         Roger


 

_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to