mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
New: Prevent Boot Loop if Config file Unauthorized access. (#554)
* New: Prevent Boot Loop if Config file Unauthorized access. * Update NzbDroneLogger.cs
This commit is contained in:
parent
e914ca86dc
commit
0596215358
5 changed files with 41 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
@ -340,14 +340,27 @@ namespace NzbDrone.Core.Configuration
|
|||
{
|
||||
throw new InvalidConfigFileException($"{_configFile} is corrupt is invalid. Please delete the config file and Lidarr will recreate it.", ex);
|
||||
}
|
||||
|
||||
catch (UnauthorizedAccessException ex)
|
||||
{
|
||||
throw new AccessDeniedConfigFileException($"Lidarr does not have access to config file: {_configFile}. Please fix permissions", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveConfigFile(XDocument xDoc)
|
||||
{
|
||||
lock (Mutex)
|
||||
try
|
||||
{
|
||||
_diskProvider.WriteAllText(_configFile, xDoc.ToString());
|
||||
lock (Mutex)
|
||||
{
|
||||
_diskProvider.WriteAllText(_configFile, xDoc.ToString());
|
||||
}
|
||||
}
|
||||
catch (UnauthorizedAccessException ex)
|
||||
{
|
||||
throw new AccessDeniedConfigFileException($"Lidarr does not have access to config file: {_configFile}. Please fix permissions", ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private string GenerateApiKey()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue