win32security.LogonUser

John Abel johnfabel at btinternet.com
Tue Jul 8 15:00:31 EDT 2003


OK, try adding it to "Replace A Process Level Token" (sorry about this, 
when I was trying to get my FTP server running, I forgot to write down, 
which ones I'd changed.  Doh!)

Here's the code I'm using, to adjust the tokens, and the calls that I make:

        self.AdjustPrivilege( ntsecuritycon.SE_CHANGE_NOTIFY_NAME )
        self.AdjustPrivilege( ntsecuritycon.SE_ASSIGNPRIMARYTOKEN_NAME )
        self.AdjustPrivilege( ntsecuritycon.SE_TCB_NAME )


    def AdjustPrivilege( self, priv ):
        flags = ntsecuritycon.TOKEN_ADJUST_PRIVILEGES | 
ntsecuritycon.TOKEN_QUERY
        htoken =  
win32security.OpenProcessToken(win32api.GetCurrentProcess(), flags)
        id = win32security.LookupPrivilegeValue(None, priv)
        newPrivileges = [(id, ntsecuritycon.SE_PRIVILEGE_ENABLED)]
        win32security.AdjustTokenPrivileges(htoken, 0, newPrivileges)

Darrell Gallion wrote:

>Thanks John
>
>That was done with no luck.
>Added it to Administrators and Administrator.
>
>
>
>__________________________________
>Do you Yahoo!?
>SBC Yahoo! DSL - Now only $29.95 per month!
>http://sbc.yahoo.com
>
>  
>






More information about the Python-list mailing list