[python-win32] File access entries are incorrectly set

2016-09-19 Thread Goku Balu
If I deny GENERIC_WRITE it denies Rc as well (Rc - Read Control). I can't even open the folder in explorer. Here is the sample code. Is this a bug? import win32security,win32api,win32con import ntsecuritycon as con import os def show_cacls (filename): for line in os.popen ("Icacls %s" % filen

Re: [python-win32] File access entries are incorrectly set

2016-09-20 Thread Goku Balu
eral > permissions mashed together, including FILE_WRITE and read control. > > Perhaps try with just FILE_WRITE on its own? > > On Tue, 20 Sep 2016, 8:03 AM Goku Balu wrote: > >> If I deny GENERIC_WRITE it denies Rc as well (Rc - Read Control). I can't >> even open the fol

Re: [python-win32] python-win32 Digest, Vol 162, Issue 4

2016-09-23 Thread Goku Balu
So if we deny WRITE then SYNCHRONIZE will be denied which will in-turn affect READ. Is there a way to deny WRITE alone without affecting file/folder read? Thanks, Goku On Tue, Sep 20, 2016 at 9:30 PM, wrote: > > > > > That doesn't seem like a bug to me. GENERIC_WRITE represents several > > per

Re: [python-win32] File access entries are incorrectly set

2016-09-27 Thread Goku Balu
Thanks Eryk for being so thorough and for a great explanation. If this can be solved differently, I tried with removing the rights such as READ_CONTROL and SYNCHRONIZE from the FILE_GENERIC_WRITE mask and it worked as well. masks= ntsecuritycon.FILE_GENERIC_WRITE masks=masks&~ntsecuritycon.READ_CO

[python-win32] Replace all child permissions

2017-03-20 Thread Goku Balu
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_per

Re: [python-win32] Replace all child permissions

2017-03-21 Thread Goku Balu
cally? Regards, Goku On Tue, Mar 21, 2017 at 3:16 AM, eryk sun wrote: > On Mon, Mar 20, 2017 at 3:13 PM, Goku Balu > wrote: > > > > Is there anyway to do "Replace all child object permissions with > inheritable > > permissions from this object" programatic

Re: [python-win32] python-win32 Digest, Vol 168, Issue 3

2017-03-21 Thread Goku Balu
ve 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

[python-win32] Context menu example not working in Win10

2017-06-20 Thread Goku Balu
Hi, The context menu example provided with pywin32 isn't working in Windows 10. Have you had any luck running it from Windows 10? ___ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32

Re: [python-win32] Context menu example not working in Win10

2017-06-22 Thread Goku Balu
Hi All, To explain things bit more clearly, I'm trying to add my own menu item to the context menu that appears for files and folders. When I was searching about how to achieve it in Python, I found this example provided with pywin32 under folder " *python36-32\Lib\site-packages\win32comext\shell\

Re: [python-win32] python-win32 Digest, Vol 171, Issue 2

2017-06-22 Thread Goku Balu
Hi Gertjan, Thanks for the response. That's a great find. Yes I've installed 32-bit python in my 64-bit windows machine. I hope you've narrowed down the issue. Is there any way to get it working? Goku Balu schreef: > > > To explain things bit more clearly, I'm t

[python-win32] Reg. taking folder ownership

2018-08-27 Thread Goku Balu
Hi, My use case is this. Folder1 is created by Admin1 and ACL is set by Admin1. Now Admin2 wants to change the ACL. I think we have two options here 1) Take folder ownership and the do the changes 2) Take elevated privileges for Admin2 account and add/remove ACL entries (Similar to "Run as Administ

Re: [python-win32] Reg. taking folder ownership

2018-08-28 Thread Goku Balu
> Eryk wrote: > This call will succeed even if one or more of the privileges wasn't > modified. In this case GetLastError() returns ERROR_NOT_ALL_ASSIGNED > (1300). This will be the case if you try to enable the take-ownership > and restore privileges for a UAC restricted token. Thanks Eryk for re