Skip to content
This repository has been archived by the owner on Feb 12, 2019. It is now read-only.

Commit

Permalink
DNN-8712: added checks for all path up to root from site's folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
galatrash committed Jun 7, 2016
1 parent 4da406e commit b273149
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Components/Checks/CheckDiskAcccessPermissions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,28 @@ private static IList<string> CheckAccessToDrives()
var errors = new List<string>();
try
{
var dir = new DirectoryInfo(Path.Combine(Globals.ApplicationMapPath, ".."));
var permissions = CheckPermissionOnDir(dir);
if (permissions.AnyYes)
var dir = new DirectoryInfo(Globals.ApplicationMapPath);
while (dir.Parent != null)
{
errors.Add(GetPermissionText(dir, permissions));
dir = dir.Parent;
var permissions = CheckPermissionOnDir(dir);
if (permissions.AnyYes)
{
errors.Add(GetPermissionText(dir, permissions));
}
}

var drives = DriveInfo.GetDrives();
foreach (var drive in drives.Where(d => d.IsReady))
foreach (var drive in drives.Where(d => d.IsReady && d.RootDirectory.Name != dir.Root.Name))
{
var driveType = drive.DriveType;
if (driveType == DriveType.Fixed || driveType == DriveType.Network)
{
dir = drive.RootDirectory;
permissions = CheckPermissionOnDir(dir);
var dir2 = drive.RootDirectory;
var permissions = CheckPermissionOnDir(dir2);
if (permissions.AnyYes)
{
errors.Add(GetPermissionText(dir, permissions));
errors.Add(GetPermissionText(dir2, permissions));
}
}
}
Expand Down

0 comments on commit b273149

Please sign in to comment.