diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-09-04 12:56:19 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-04 12:56:19 -0500 |
| commit | d3d0165fcc83104215fd6df7321fac2309e68e58 (patch) | |
| tree | 749fa5c99b5dccc10fc423dc6198e9b7ab669cfd /src | |
| parent | 05ce3650a2afbfbc08c3903dccdec4a3526a3cd1 (diff) | |
| parent | 731b371d25e84536745f3987cc83344d8e7e0262 (diff) | |
| download | slskd-d3d0165fcc83104215fd6df7321fac2309e68e58.tar.gz | |
Merge pull request #630 from slskd/slash-replacement
Ignore files and directories containing backslashes while scanning. Warn users if files are ignored.
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Shares/SharedFileCache.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/slskd/Shares/SharedFileCache.cs b/src/slskd/Shares/SharedFileCache.cs index 3a41f61b..9902c951 100644 --- a/src/slskd/Shares/SharedFileCache.cs +++ b/src/slskd/Shares/SharedFileCache.cs @@ -253,6 +253,12 @@ namespace slskd.Shares { Log.Debug("Starting scan of {Directory} ({Current}/{Total})", directory, current + 1, unmaskedDirectories.Count); + if (Path.DirectorySeparatorChar == '/' && directory.Contains('\\')) + { + Log.Warning("Directory name {Directory} contains one or more backslashes, which are not currently supported. This directory will not be shared.", directory); + continue; + } + var addedFiles = 0L; var filteredFiles = 0L; @@ -287,6 +293,12 @@ namespace slskd.Shares continue; } + if (Path.DirectorySeparatorChar == '/' && file.Value.Filename.Contains('\\')) + { + Log.Warning("Filename {Filename} contains one or more backslashes, which are not currently supported. This file will not be shared.", file.Value.Filename); + continue; + } + if (files.ContainsKey(file.Key)) { Log.Warning($"File {file.Key} shared in directory {directory} has already been cached. This is probably a misconfiguration of the shared directories (is a subdirectory being re-shared?)."); |
