From 873134fceed61ee51853466fca129f194ce28015 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sat, 14 Sep 2013 17:08:16 -0700 Subject: [PATCH] guard against InheritFolderPermissionsNotImplementedException in linux. --- NzbDrone.Common/DiskProvider.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/NzbDrone.Common/DiskProvider.cs b/NzbDrone.Common/DiskProvider.cs index 1affaceb4..56180cdda 100644 --- a/NzbDrone.Common/DiskProvider.cs +++ b/NzbDrone.Common/DiskProvider.cs @@ -271,9 +271,19 @@ namespace NzbDrone.Common { Ensure.That(() => filename).IsValidPath(); - var fs = File.GetAccessControl(filename); - fs.SetAccessRuleProtection(false, false); - File.SetAccessControl(filename, fs); + try + { + var fs = File.GetAccessControl(filename); + fs.SetAccessRuleProtection(false, false); + File.SetAccessControl(filename, fs); + } + catch (NotImplementedException) + { + if (!OsInfo.IsLinux) + { + throw; + } + } } public long? GetAvailableSpace(string path)