How to impersonate the child process of an ASP.NET application
From: Aadil Abbas (maa49_at_cornell.edu)
Date: 07/29/03
- Next message: Cash Foley: "Attempting to stop a Windows Service in a Web Application"
- Previous message: Mike LeBlanc: "RE: Sharing Authentication cookies between 1.0 and 1.1"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 29 Jul 2003 14:29:18 -0400
I am running a web service on IIS 6.0, impersonation is set to true, so my
web service can access resources depending on the client's privileges, but
when I launch a child process from the web service, this child process does
not inherit the security context of its parent (impersonated) thread. How
can I delegate this impersonation to the child process without making any
calls to unmanaged code like CreateProcess etc.
Here is my C# code, that is run from a web service, creates a child process
(a command shell) and tries to access a network resource. This child process
runs as
"NT Authority\Network Service" and therefore cannot access network
resources. I want to impersonate this child process, so it can access
network resources depending on the rights of client.
Process proc = new Process();
proc.StartInfo.FileName = "cmd";
proc.StartInfo.Arguments = "/k "+str+ " > h:\\temp\\log.txt";
proc.StartInfo.WorkingDirectory = @"h:\temp";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = true;
proc.Start();
Thanks
Aadil
- Next message: Cash Foley: "Attempting to stop a Windows Service in a Web Application"
- Previous message: Mike LeBlanc: "RE: Sharing Authentication cookies between 1.0 and 1.1"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|