Re: win32security.LogonUser

Discussion in 'Python' started by John Abel, Jul 8, 2003.

  1. John Abel

    John Abel Guest

    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
    >
    >
    >
     
    John Abel, Jul 8, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mary Chipman

    Re: Impersonation in ASPNET and LogonUser

    Mary Chipman, Sep 3, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    471
    Mary Chipman
    Sep 3, 2003
  2. Darrell

    win32security.LogonUser

    Darrell, Jul 8, 2003, in forum: Python
    Replies:
    1
    Views:
    1,370
    John Abel
    Jul 8, 2003
  3. Darrell Gallion

    Re: win32security.LogonUser

    Darrell Gallion, Jul 8, 2003, in forum: Python
    Replies:
    0
    Views:
    530
    Darrell Gallion
    Jul 8, 2003
  4. Emin.shopper Martinian.shopper

    subprocess and win32security.ImpersonateLoggedOnUser

    Emin.shopper Martinian.shopper, Jun 1, 2009, in forum: Python
    Replies:
    0
    Views:
    367
    Emin.shopper Martinian.shopper
    Jun 1, 2009
  5. Tim Golden
    Replies:
    0
    Views:
    411
    Tim Golden
    Jun 1, 2009
Loading...

Share This Page