[python-win32] Folder Permissions - Inherit problem
Feiock, Dennis
DFeiock at ameripath.com
Wed Mar 29 14:19:55 CEST 2006
> Dennis Feiock wrote:
>> When I tested using AddAccessAllowedAceEx on a folder, I noticed that
the existing subfolders that have inheritance enabled do
>> not automatically take on the added permission. When creating a new
folder, it added the ACE as it should. Any suggestions?
>> Here is the code I used (note: I couldn't find information on the
SetDacl options, so that might be it):
...
>>>>
win32security.SetFileSecurity(fullpath,win32security.DACL_SECURITY_INFOR
MATION,sd1)
> Try using SetNamedSecurityInfo instead. I think SetFileSecurity is
actually considered
> obsolete now.
> After playing around with both of these, it appears
SetNamedSecurityInfo will
> cause the inherited ACEs to propagate to existing subfolders, whereas
SetFileSecurity doesn't.
> win32security.SetNamedSecurityInfo(fullpath,
win32security.SE_FILE_OBJECT,
> win32security.DACL_SECURITY_INFORMATION,None, None, dacl1,
None)
> hth
> Roger
Using SetNamedSecurityInfo did the trick. Thanks a lot for all your
help. By the way, do you know a good source of information for win32
api stuff? The resource I am using (ActivePython's documentation)
doesn't make any note about the SetFileSecurity function's limitations
or being obsolete and I would like to avoid beating my head against the
wall in the future.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20060329/70de2958/attachment.html
More information about the Python-win32
mailing list