How to impersonate the child process of an ASP.NET application

Discussion in 'ASP .Net Security' started by Aadil Abbas, Jul 29, 2003.

  1. Aadil Abbas

    Aadil Abbas Guest

    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
     
    Aadil Abbas, Jul 29, 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. Jeff Rodriguez
    Replies:
    23
    Views:
    1,204
    David Schwartz
    Dec 9, 2003
  2. empriser
    Replies:
    1
    Views:
    660
    Ian Collins
    Mar 6, 2007
  3. Bill Belliveau

    DirectoryEntry Impersonate or WindowsIdentity Impersonate?

    Bill Belliveau, Jan 28, 2004, in forum: ASP .Net Security
    Replies:
    3
    Views:
    419
    Joe Kaplan \(MVP - ADSI\)
    Jan 31, 2004
  4. Aadil Abbas

    How to impersonate the child process of a web service

    Aadil Abbas, Jul 29, 2003, in forum: ASP .Net Web Services
    Replies:
    6
    Views:
    563
    Aadil Abbas
    Aug 4, 2003
  5. Z W
    Replies:
    0
    Views:
    197
Loading...

Share This Page