[python-win32] Using win32security from IIS/CGI script
I-McTaggart, Peter
peter.mctaggart at boeing.com
Wed Oct 19 07:01:58 CEST 2005
Hi Roger,
I am printing GetUserName() and it is the correct user (ie my user id).
I haven't tried to normally open the file - but will give it a go. I'm
travelling now so it ay take a week or so before I get to it.
Thanks
Peter
-----Original Message-----
From: Roger Upole [mailto:rwupole at msn.com]
Sent: Sunday, October 16, 2005 7:52 AM
To: python-win32 at python.org
Subject: [python-win32] Re: Using win32security from IIS/CGI script
> Hi,
>
> I'm trying to call the following win3security API as part of a CGI
> script being served up by IIS6 on W2k3.
>
> secDes = win32security.GetNamedSecurityInfo(filename, \
> win32security.SE_FILE_OBJECT, \
> win32security.DACL_SECURITY_INFORMATION \
> win32security.GROUP_SECURITY_INFORMATION \
> win32security.OWNER_SECURITY_INFORMATION)
>
> I have got the script running from a secure page (NT Auth) in the
> context of the user that is calling the script through IIS but I am
> getting an access denied error, as indicated below
>
> E:\Inetpub\tools\AccessList.py in
> getAceList(filename=r'\\server\somefile')
> secDes = win32security.GetNamedSecurityInfo(filename, \
> win32security.SE_FILE_OBJECT, \
> win32security.DACL_SECURITY_INFORMATION \
> | win32security.GROUP_SECURITY_INFORMATION \
> | win32security.OWNER_SECURITY_INFORMATION)
>
> global win32security = <module 'win32security' from 'C:\Program
> Files\Python24\lib\site-packages\win32\win32security.pyd'>,
> win32security.DACL_SECURITY_INFORMATION = 4,
> win32security.GROUP_SECURITY_INFORMATION = 2,
> win32security.OWNER_SECURITY_INFORMATION = 1
>
> error: (5, 'GetNamedSecurityInfo', 'Access is denied.') args = (5,
> 'GetNamedSecurityInfo', 'Access is denied.')
>
> I can confirm that it is running in the context of me as a user and
> This works ok if I run it interactively from PythonWin directly on the
> server under my account.
>
> Can anyone point me in the right direction?
>
> Thanks
> Peter
Can you do a normal open on the file, or is just the security functions
that fail ? Also, how are you verifying that the script is running as
you when run under CGI?
Does win32api.GetUserName() return your user id ?
Roger
_______________________________________________
Python-win32 mailing list
Python-win32 at python.org
http://mail.python.org/mailman/listinfo/python-win32
More information about the Python-win32
mailing list