Groups | Blog | Home
all groups > dotnet security > september 2004 >

dotnet security : System.IO.File.Copy(..,..) doesn't really work (WinApp)


gotchafighter NO[at]SPAM gmx.de
9/8/2004 11:19:43 AM
1. signed assembly with a StrongName
2. Caspol -m -af MyUpdServ.exe


Following Code functioned:

File.Copy(@"\\SERVER01\MyApp\MyApp.exe", @"C:\Programme\MyApp\MyApp.exe", true);


Following Code not functioned:

File.Copy(@"\\SERVER01\MyApp\MyApp.xml", @"C:\Programme\MyApp\MyApp.xml", true);

-> here was throw a System.UnauthorizedAccessException


Toby Herring
9/8/2004 2:34:31 PM
Sounds like you don't have permission to read the XML file.

Either that, or the XML file already exists at the target destination, but
it's either locked by an application or you don't have permission to modify
it.

--
Toby Herring
MCDBA, MCSD, MCP+SB
Need a Second Life?
http://secondlife.com/ss/?u=03e0e5b303c234bf08e80ee40119a65e


[quoted text, click to view]

shawnfa NO[at]SPAM online.microsoft.com (
9/8/2004 11:41:38 PM
I'd agree with that assesment. It's important to realize that CAS security sits on top of NT security, and does not replace it. Even if the CLR will
allow you to read or write a file (ie you have the correct FileIO permissions), ACLs on the NTFS (or ACLs on the file share you're writing to) may still
prevent the access.

-Shawn
http://blogs.msdn.com/shawnfa

--

This posting is provided "AS IS" with no warranties, and confers no rights.
Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they
originated.
--------------------
[quoted text, click to view]

AddThis Social Bookmark Button