process StandardOutput Security Inquiry

Discussion in 'ASP .Net Security' started by shellyshao, Feb 16, 2006.

  1. shellyshao

    shellyshao Guest

    Hi, I have an ASP.NET web application running with following code:
    System.Diagnostics.Process runner = new System.Diagnostics.Process();


    runner.StartInfo.FileName = "fc.exe";
    runner.StartInfo.Arguments = strFile1 + " " + strFile2;


    runner.StartInfo.WorkingDirectory = strFileRoot;
    runner.StartInfo.UseShellExecute = false;
    runner.StartInfo.RedirectStandardOutput = true;
    runner.StartInfo.RedirectStandardError=true;
    runner.Start();

    StreamWriter sw = new StreamWriter(strFileRoot+
    "\\diff.txt",false);
    string strDiff = runner.StandardOutput.ReadToEnd();
    thisPage.Trace.Write("running under:"+ Environment.UserName);
    thisPage.Trace.Write("running
    under:"+System.Security.Principal.WindowsIdentity.GetCurrent().Name);
    thisPage.Trace.Write("fc.exe "+strFile1+"
    "+strFile2+":"+strFileRoot+":"+runner.StandardError.ReadToEnd() +
    ":"+strDiff);
    sw.Write(strDiff);
    sw.Close();

    runner.WaitForExit();
    runner.Close();


    It works fine on my windows XP + SP2 machine. However, on a windows
    2003 server, strDiff is always empty and starndarderror is also empty.
    I do notice it runs as aspnet on windows xp, but as network service
    acount on 2003. So I impersonated to a domain account and also added
    that domain account to admin groups on the windows 2003 machine, but
    still strDiff returns empty. Please please please help.

    Haiping
     
    shellyshao, Feb 16, 2006
    #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. Debashish
    Replies:
    3
    Views:
    1,826
    Mike Treseler
    Aug 8, 2003
  2. Leon Shaw

    Databinding Inquiry

    Leon Shaw, Jul 11, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    385
    Leon Shaw
    Jul 11, 2003
  3. Joe Van Meer

    data relations and datasets inquiry

    Joe Van Meer, May 5, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    436
    Joe Van Meer
    May 5, 2004
  4. Steve B.
    Replies:
    3
    Views:
    4,066
    Steve B.
    Apr 10, 2006
  5. Harald Fichtner

    ASP 1.1 - StandardOutput from console application

    Harald Fichtner, Oct 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    413
    Cowboy \(Gregory A. Beamer\)
    Oct 6, 2006
Loading...

Share This Page