mirror of
https://github.com/Radarr/Radarr
synced 2026-05-08 14:40:51 +02:00
Add log sanitization for CodeQL log forging alerts
This commit is contained in:
parent
b1f50bae97
commit
1190d218af
3 changed files with 7 additions and 6 deletions
|
|
@ -138,7 +138,7 @@ public bool FolderWritable(string path)
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Trace("Directory '{0}' isn't writable. {1}", path, e.Message);
|
||||
Logger.Trace("Directory '{0}' isn't writable. {1}", path.SanitizeForLog(), e.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -206,7 +206,7 @@ public long GetFileSize(string path)
|
|||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
Logger.Trace(ex, "Unable to resolve symlink target for {0}", path);
|
||||
Logger.Trace(ex, "Unable to resolve symlink target for {0}", path.SanitizeForLog());
|
||||
}
|
||||
|
||||
return fi.Length;
|
||||
|
|
@ -534,7 +534,7 @@ public virtual IMount GetMount(string path)
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Debug(ex, $"Failed to get mount for path {path}");
|
||||
Logger.Debug(ex, "Failed to get mount for path {0}", path.SanitizeForLog());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Extensions;
|
||||
|
||||
namespace NzbDrone.Common.EnsureThat
|
||||
{
|
||||
|
|
@ -9,13 +10,13 @@ internal static class ExceptionFactory
|
|||
|
||||
internal static ArgumentException CreateForParamValidation(string paramName, string message)
|
||||
{
|
||||
Logger.Warn(message);
|
||||
Logger.Warn(message.SanitizeForLog());
|
||||
return new ArgumentException(message, paramName);
|
||||
}
|
||||
|
||||
internal static ArgumentNullException CreateForParamNullValidation(string paramName, string message)
|
||||
{
|
||||
Logger.Warn(message);
|
||||
Logger.Warn(message.SanitizeForLog());
|
||||
return new ArgumentNullException(paramName, message);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ public async Task DownloadFileAsync(string url, string fileName)
|
|||
fileInfo.Directory.Create();
|
||||
}
|
||||
|
||||
_logger.Debug("Downloading [{0}] to [{1}]", url, fileName);
|
||||
_logger.Debug("Downloading [{0}] to [{1}]", url.SanitizeForLog(), fileName.SanitizeForLog());
|
||||
|
||||
var stopWatch = Stopwatch.StartNew();
|
||||
await using (var fileStream = new FileStream(fileNamePart, FileMode.Create, FileAccess.ReadWrite))
|
||||
|
|
|
|||
Loading…
Reference in a new issue