1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-26 01:38:24 +00:00

Fixed: Mount handling logic of net namespaces as seen on QNAP.

fixes #1483
This commit is contained in:
Taloth Saldono 2016-11-01 22:18:25 +01:00
parent 9519f3137c
commit 0411b82e65

View file

@ -74,7 +74,7 @@ private Dictionary<string, bool> GetFileSystems()
{ {
_logger.Debug(ex, "Failed to get filesystem types from {0}, using default set.", PROC_FILESYSTEMS_FILENAME); _logger.Debug(ex, "Failed to get filesystem types from {0}, using default set.", PROC_FILESYSTEMS_FILENAME);
} }
if (result.Empty()) if (result.Empty())
{ {
foreach (var type in _fixedTypes) foreach (var type in _fixedTypes)
@ -96,6 +96,7 @@ private IMount ParseLine(string line)
if (split.Length != 6) if (split.Length != 6)
{ {
_logger.Debug("Unable to parse {0} line: {1}", PROC_MOUNTS_FILENAME, line); _logger.Debug("Unable to parse {0} line: {1}", PROC_MOUNTS_FILENAME, line);
return null;
} }
var name = split[0]; var name = split[0];
@ -103,6 +104,13 @@ private IMount ParseLine(string line)
var type = split[2]; var type = split[2];
var options = ParseOptions(split[3]); var options = ParseOptions(split[3]);
if (!mount.StartsWith("/"))
{
// Possible a namespace like 'net:[1234]'.
// But we just filter anything not starting with /, we're not interested in anything that isn't mounted somewhere.
return null;
}
var driveType = FindDriveType.Find(type); var driveType = FindDriveType.Find(type);
if (name.StartsWith("/dev/") || GetFileSystems().GetValueOrDefault(type, false)) if (name.StartsWith("/dev/") || GetFileSystems().GetValueOrDefault(type, false))