Fixed #3373 - LVM: Backup failure on removed files

Fixes a problem in IsBlockDevice(localPath) which throws an exception when a path that exists in the snapshot is removed from the disk during the backup.
This commit is contained in:
jkellerer
2018-09-14 12:00:20 +02:00
committed by juergen kellerer
parent b4a031f6a8
commit fde179c2a2
+18 -8
View File
@@ -487,18 +487,28 @@ namespace Duplicati.Library.Snapshots
/// <param name="localPath">The file or folder to examine</param>
public override bool IsBlockDevice(string localPath)
{
var n = UnixSupport.File.GetFileType(SystemIOLinux.NormalizePath(localPath));
switch (n)
try
{
case UnixSupport.File.FileType.Directory:
case UnixSupport.File.FileType.Symlink:
case UnixSupport.File.FileType.File:
var n = UnixSupport.File.GetFileType(SystemIOLinux.NormalizePath(localPath));
switch (n)
{
case UnixSupport.File.FileType.Directory:
case UnixSupport.File.FileType.Symlink:
case UnixSupport.File.FileType.File:
return false;
default:
return true;
}
}
catch
{
if (!System.IO.File.Exists(SystemIOLinux.NormalizePath(localPath)))
return false;
default:
return true;
throw;
}
}
/// <summary>
/// Gets a unique hardlink target ID
/// </summary>