win32 all question, win32security, impersonation

Syver Enstad syver-en+usenet at online.no
Thu May 23 17:20:33 EDT 2002


Mark Hammond <mhammond at skippinet.com.au> writes:

> Syver Enstad wrote:
> > I was fiddling around with mount points on win2k (using windll) the
> > other day, and discovered that I had to be administrator to delete
> 
> The next version of win32file has support for this ;)

Cool.

<snip> about AdjustTokenPrivilege
> 
> MSDN documents that this error code may be returned from
> GetLastError(), even when the function succeeds.  It appears this
> error is informing you that it didn't actually need to enable the
> privilege, or something like that ;)
> 
> I have fixed win32security to ignore that error code (as many online
> C++ samples do) - you can always call GetLastError() yourself to get
> the error code :) In the meantime you should be able to simply ignore
> 
> the exception if the error code portion is
> winerror.ERROR_NOT_ALL_ASSIGNED
> 
> Mark.
> 

Still doesn't work, as far as I remember I already tried it. Well,
well, win32 security have always given me the creeps anyway ;-)


securityHandle = win32security.LogonUser(
    '<username>', '.',
    '<password>',
    win32security.LOGON32_LOGON_INTERACTIVE,
    win32security.LOGON32_PROVIDER_DEFAULT)


Traceback (most recent call last):
  File "H:\MyDocuments\spike.py", line 35, in ?
    win32security.LOGON32_PROVIDER_DEFAULT)
api_error: (
1314, 'LogonUser', 'A required privilege is not held by the client.'
)
> h:\mydocuments\spike.py(35)?()
-> win32security.LOGON32_PROVIDER_DEFAULT)


-- 

Vennlig hilsen 

Syver Enstad



More information about the Python-list mailing list