From c89de5d4bcb56202a6879d752a685a7fc81d2920 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 3 Jun 2026 08:57:19 -0500 Subject: temporarily back out destination permissions --- src/slskd/Core/Options.cs | 37 ------------------------ src/slskd/Transfers/Downloads/DownloadService.cs | 4 +-- 2 files changed, 2 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs index 4e7dca7b..f2a78247 100644 --- a/src/slskd/Core/Options.cs +++ b/src/slskd/Core/Options.cs @@ -1082,43 +1082,6 @@ namespace slskd /// [Enum(typeof(DestinationExistsStrategy))] public string Exists { get; init; } = DestinationExistsStrategy.Rename.ToString().ToLowerInvariant(); - - /// - /// Gets the permissions to apply to downloaded files and directories. - /// - [Validate] - public DestinationPermissionsOptions Permissions { get; init; } = new DestinationPermissionsOptions(); - - /// - /// Download destination permission options. - /// - public class DestinationPermissionsOptions : IValidatableObject - { - /// - /// Gets the permissions to apply to newly created files. - /// - /// - /// Applicable to non-Windows operating systems, only. - /// - public string Mode { get; init; } - - public IEnumerable Validate(ValidationContext validationContext) - { - var results = new List(); - - if (!string.IsNullOrEmpty(Mode)) - { - var regEx = new Regex("^[0-7]{3,4}$", RegexOptions.Compiled); - - if (!regEx.IsMatch(Mode)) - { - results.Add(new ValidationResult($"Field {nameof(Mode)} is invalid. Specify a three- or four-character string consisting of only 0-7 (chmod syntax, [0]000-[7]777, inclusive)")); - } - } - - return results; - } - } } } diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs index 48c29b19..85de28b0 100644 --- a/src/slskd/Transfers/Downloads/DownloadService.cs +++ b/src/slskd/Transfers/Downloads/DownloadService.cs @@ -1218,8 +1218,8 @@ namespace slskd.Transfers.Downloads }), disposeOutputStreamOnCompletion: true); - UnixFileMode? unixFileMode = !string.IsNullOrEmpty(OptionsMonitor.CurrentValue.Transfers.Download.Destination.Permissions.Mode) - ? OptionsMonitor.CurrentValue.Transfers.Download.Destination.Permissions.Mode.ToUnixFileMode() + UnixFileMode? unixFileMode = !string.IsNullOrEmpty(OptionsMonitor.CurrentValue.Permissions.File.Mode) + ? OptionsMonitor.CurrentValue.Permissions.File.Mode.ToUnixFileMode() : null; /* -- cgit v1.2.3