[python-win32] python-win32 Digest, Vol 168, Issue 3
Goku Balu
tfa.signup.test1 at gmail.com
Tue Mar 21 06:08:58 EDT 2017
Hi Michel,
Thanks for the response. Yes that's an option available. I've already tried
this for setting permissions on files and folders. Since each invocation
constitutes a System Call, it fills up the stack easily and the OS denies
the handle thereafter. I'm trying to achieve it in a more native and
pythonic way.
Regards,
Goku
Le 20.03.17 ? 16:13, Goku Balu a ?crit :
> > Hi all,
> >
> > Is there anyway to do "Replace all child object permissions with
> > inheritable permissions from this object" programatically using
> > PyWin32. I found out that this resets the permissions for all the
> > sub-folders and files deep-down even though the permissions are set
> > separately.
> >
> > def remove_permission(path):
> > sd = win32security.GetFileSecurity(path,
> > win32security.DACL_SECURITY_INFORMATION)
> > dacl = sd.GetSecurityDescriptorDacl() # instead of dacl =
> > win32security.ACL()
> > win32security.SetNamedSecurityInfo(path,
> > win32security.SE_FILE_OBJECT, win32security.DACL_SECURITY_INFORMATION
> > | win32security.UNPROTECTED_DACL_SECURITY_INFORMATION, None, None,
> > dacl, None)
> >
> > I tried this on a folder. But didn't work.
> >
Hi!
>
> You can call the Windows's command* CACLS *(in command line).
>
> @+
> --
> Michel Claveau
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20170321/cf13bf04/attachment.html>
More information about the python-win32
mailing list