diff options
| -rw-r--r-- | config/slskd.example.yml | 2 | ||||
| -rw-r--r-- | src/slskd/Core/Options.cs | 37 | ||||
| -rw-r--r-- | src/slskd/Transfers/Downloads/DownloadService.cs | 4 |
3 files changed, 2 insertions, 41 deletions
diff --git a/config/slskd.example.yml b/config/slskd.example.yml index b66879e3..f616cd8a 100644 --- a/config/slskd.example.yml +++ b/config/slskd.example.yml @@ -81,8 +81,6 @@ # destination: # subdirectory: {SOURCE_DIRECTORY} # exists: rename # 'overwrite' or 'rename' -# permissions: -# mode: ~ # chmod syntax, e.g. 644, 777. does nothing on Windows. # groups: # default: # upload: 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 /// </summary> [Enum(typeof(DestinationExistsStrategy))] public string Exists { get; init; } = DestinationExistsStrategy.Rename.ToString().ToLowerInvariant(); - - /// <summary> - /// Gets the permissions to apply to downloaded files and directories. - /// </summary> - [Validate] - public DestinationPermissionsOptions Permissions { get; init; } = new DestinationPermissionsOptions(); - - /// <summary> - /// Download destination permission options. - /// </summary> - public class DestinationPermissionsOptions : IValidatableObject - { - /// <summary> - /// Gets the permissions to apply to newly created files. - /// </summary> - /// <remarks> - /// Applicable to non-Windows operating systems, only. - /// </remarks> - public string Mode { get; init; } - - public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) - { - var results = new List<ValidationResult>(); - - 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; /* |
