Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

Permissions Issues: Process.Start() & XCOPY

I am using a C# / ASP.NET application to fire an XCOPY job from the webserver to a  UNC share.  This setup works fine when copying to a local machine but refuses to work on the remote copy. The process executes correctly, but XCOPY returns "invalid drive specification", which I'm guessing actually means that the current user context (ASP.NET application) can't access the share (e.g. \\someserver\c$\mydir\)

Anyway, here's where I'm at with permissions:

* Changed the ASPNET account to run as System in machine.config (reboot)
* added     
<identity impersonate="true" userName="MY_DOMAIN\\administrator" password="xxxx" /> to web.config

* Interesting note: when I display the current uiser the ASP.NET app is running under, I get MACHINENAME/Administrator, not DOMAIN/Administrator.  This seems wrong?

Other examples on the web seem to indicate that this is an issue with System.Diagnostics.Process, in that it incorrectly uses the user token, blah blah, (i.e. a bug in .NET).  System.Diagnostics.Process doesn't have the capability to supply user credentials to the process it runs (a somewhat ridiculous omission)

Any ideas here?  TIA.

Sassy
Monday, June 07, 2004

PROBLEM SOLVED~!
http://www.kennyandkarin.com/Kenny/CodeCorner/SourceCode/#The%20Kerr.Windows%20Assembly%20(17%20July%202002)

Sassy
Tuesday, June 08, 2004

Don't forget to set your machine.config back - you've opened a giant security risk if any asp.net application is compromised.

Greg Hurlman
Tuesday, June 08, 2004

Hi,

Ive tried using the Kerr.Windows.Security dll to change the user so that I can xcopy to a mapped network drive. However, it returns the followin error:
"A required privilege is not held by the client"

I have tried going into the security settings on the machine where the .net application is running (my own machine for the moment) and adding in the user to the "Act as part of teh operating system" user accounts, but this doesn't work.

Any ideas please? This is pretty urgent.

Many thanks

R

Richard Slade
Wednesday, June 23, 2004

*  Recent Topics

*  Fog Creek Home