Re: Question about Permissions
From: William DePalo [MVP VC++] (willd.no.spam_at_mvps.org)
Date: 09/16/04
- Next message: CheckAbdoul: "Re: CD unit can burn CD/DVD ?"
- Previous message: Lori Pearce \(MSFT\): "Re: is there an IE sdk???"
- In reply to: Ron M. Newman: "Question about Permissions"
- Next in thread: Ron M. Newman: "Re: Question about Permissions"
- Reply: Ron M. Newman: "Re: Question about Permissions"
- Reply: Ron M. Newman: "Re: Question about Permissions"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 16 Sep 2004 18:20:58 -0400
"Ron M. Newman" <ronmnewman@newman.com> wrote in message
news:uupig8CnEHA.2680@TK2MSFTNGP15.phx.gbl...
> - Suppose I am the administrator and I am running a certain process. Let's
> assume I have the userID and password of another user with lesser
> permissions. Is there any way to programmatically spawn a process or a
> thread that would have the permissions (file permissions) matching what
> that user would have if it were logged in?
Yes. CreateProcessWithLogon() is probably the most straightforward way.
Do you know that you can create a shortcut to an application and select the
"Run with different credentials" as well? When the shortcut is clicked, the
user is presented a dialog in which he can enter the credentials of the
target.
> - On the same level, can an NT Service create a thread or spaen a process
> that would have the permissions of a certain user it has the
> userID+password for?
Services live to do this. The topic in question is called "Client
Impersonation" and is quite broad. You might want to start reading here:
To cut to the chase look up LogonUser(), ImpersonateLoggedOnUser() and
RevertToSelf() for the details. Note that services don't necessarily need
their clients' passwords. If the client and service communicate via an
"impersonable" channel, the service can just tell the operating system to
impersonate the client as the operating system knows full well who is at the
other end. Check the docs for ImpersonateNamedPipeClient(),
DdeImpersonateClient() and RpcImpersonateClient(), for example, for more
information.
> and do that without log the current user out?
No. Services run with or without users logged on to the machine. What
changes is the service's security context, not the user's.
Regards,
Will
- Next message: CheckAbdoul: "Re: CD unit can burn CD/DVD ?"
- Previous message: Lori Pearce \(MSFT\): "Re: is there an IE sdk???"
- In reply to: Ron M. Newman: "Question about Permissions"
- Next in thread: Ron M. Newman: "Re: Question about Permissions"
- Reply: Ron M. Newman: "Re: Question about Permissions"
- Reply: Ron M. Newman: "Re: Question about Permissions"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|