[python-win32] Using win32security from IIS/CGI script

I-McTaggart, Peter peter.mctaggart at boeing.com
Thu Oct 13 07:16:00 CEST 2005


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



More information about the Python-win32 mailing list