aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Common/Validation/FileExistsAttribute.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-11-08 10:15:14 -0600
committerGitHub <noreply@github.com>2026-11-08 10:15:14 -0600
commit169bb8a3c0098599a617d8553e93c694bd813795 (patch)
tree4d825302717fc76d543b6a24469ad23a605cd5c8 /src/slskd/Common/Validation/FileExistsAttribute.cs
parent4eaa2b13e2da250d7b89073a15e9f1e077661fd7 (diff)
parentcefdcd02e28b1f02f546002fdd475de4fa03e839 (diff)
downloadslskd-169bb8a3c0098599a617d8553e93c694bd813795.tar.gz
Merge branch 'master' into dependabot/npm_and_yarn/src/web/follow-redirects-1.16.2
Diffstat (limited to 'src/slskd/Common/Validation/FileExistsAttribute.cs')
-rw-r--r--src/slskd/Common/Validation/FileExistsAttribute.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/slskd/Common/Validation/FileExistsAttribute.cs b/src/slskd/Common/Validation/FileExistsAttribute.cs
index c4d97a7c..6fc50f63 100644
--- a/src/slskd/Common/Validation/FileExistsAttribute.cs
+++ b/src/slskd/Common/Validation/FileExistsAttribute.cs
@@ -32,6 +32,7 @@
namespace slskd.Validation
{
+ using System;
using System.ComponentModel.DataAnnotations;
using System.IO;
@@ -71,7 +72,7 @@ namespace slskd.Validation
using var fs = File.Open(file, FileMode.Open, FileAccess.Value);
fs.Close();
}
- catch (IOException)
+ catch (Exception ex) when (ex is IOException || ex is UnauthorizedAccessException)
{
return new ValidationResult($"The {validationContext.DisplayName} field specifies a file '{file}' that cannot be opened for required access '{FileAccess}'");
}