subprocess and win32security.ImpersonateLoggedOnUser

  • Thread starter Emin.shopper Martinian.shopper
  • Start date
E

Emin.shopper Martinian.shopper

Dear Experts,

I am having some issues with the subprocess module and how it
interacts with win32security.ImpersonateLoggedOnUser. Specifically, I
use the latter to change users but the new user does not seem to be
properly inherited when I spawn further subprocesses.

I am doing something like

import win32security, win32con
handle = win32security.LogonUser(
user,domain,password,win32con.LOGON32_LOGON_INTERACTIVE,
win32con.LOGON32_PROVIDER_DEFAULT)

win32security.ImpersonateLoggedOnUser(handle)

Then spawning subprocesses but the subprocesses cannot read the same
UNC paths that that the parent could.

Any advice on either spawning subprocesses which inherit parent user
properly or changing users in a better way on Windows would be greatly
appreciated.

Thanks,
-Emin
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top