NTFS permissions

Mark Hammond MarkH at ActiveState.com
Mon Apr 23 19:27:46 EDT 2001


Tim Howarth wrote:

> My problem with directories not accepting security descriptors was
> not quite correct.
> 
> When using;
> 
> acl.AddAccessAllowedAce(win32file.FILE_ALL_ACCESS, sidUser)
> 
> sd.SetSecurityDescriptorDacl(1, acl, 0)
> 
> win32security.SetFileSecurity('g:\\TestACL\\pot',win32security.
> DACL_SECURITY_INFORMATION,sd)
> 
> 
> 
> The access is set for the directory but doesn't appear in the
> Explorer permissions viewer (Win 2000) because AFAICT the permissions
> will not be inherited by subdirectories or files (with these switched on
> the access 'ticks' appear).

> 
> So next problem how do I turn them on programmatically ?


It appears the win32 extensions lack this capability.  My MSDN CD has an 
article "HOWTO: Set Security on a NTFS Folder Programmatically" that 
shows exactly what you want (although in VB code!).

It would be cool to add this support, and not _too_ much work - I would 
be happy to help, but don't have the time to do it all right now...

Mark.




More information about the Python-list mailing list