fixes System.UnauthorizedAccessExceptions when trying to load OARs from

read-only files on linux.
0.6.5-rc1
Dr Scofield 2009-04-17 08:11:34 +00:00
parent bbe1e19696
commit 3b70d14e62
1 changed files with 2 additions and 2 deletions

View File

@ -425,14 +425,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{ {
if (File.Exists(path)) if (File.Exists(path))
{ {
return new FileStream(path, FileMode.Open); return new FileStream(path, FileMode.Open, FileAccess.Read);
} }
else else
{ {
Uri uri = new Uri(path); // throw exception if not valid URI Uri uri = new Uri(path); // throw exception if not valid URI
if (uri.Scheme == "file") if (uri.Scheme == "file")
{ {
return new FileStream(uri.AbsolutePath, FileMode.Open); return new FileStream(uri.AbsolutePath, FileMode.Open, FileAccess.Read);
} }
else else
{ {