Skip to content

Commit 43cc4e8

Browse files
authored
Fix Bug #3646: broken symlinks log error despite 'skip_symlinks = true' (#3656)
Ensure symbolic links are skipped at the start of syncEngine.scanPathForNewData() when skip_symlinks = "true" is configured. This prevents filesystem checks such as exists() and isDir() from being performed on dangling symlinks, which could trigger errors like "No such file or directory" during local scans.
1 parent ea20a1a commit 43cc4e8

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/sync.d

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7718,8 +7718,17 @@ class SyncEngine {
77187718
logKey = generateAlphanumericString();
77197719
displayFunctionProcessingStart(thisFunctionName, logKey);
77207720
}
7721-
7722-
// Add a processing '.'
7721+
7722+
// Skip symlinks as early as possible, including dangling symlinks
7723+
if (isSymlink(path)) {
7724+
// Should this path be skipped?
7725+
if (appConfig.getValueBool("skip_symlinks")) {
7726+
if (verboseLogging) {addLogEntry("Skipping item - skip symbolic links configured: " ~ path, ["verbose"]);}
7727+
return;
7728+
}
7729+
}
7730+
7731+
// Add a processing '.' if path exists
77237732
if (exists(path)) {
77247733
if (isDir(path)) {
77257734
if (!appConfig.suppressLoggingOutput) {
@@ -7764,7 +7773,7 @@ class SyncEngine {
77647773
return;
77657774
}
77667775
}
7767-
7776+
77687777
// A short lived item that has already disappeared will cause an error - is the path still valid?
77697778
if (!exists(path)) {
77707779
addLogEntry("Skipping path - path has disappeared: " ~ path);

0 commit comments

Comments
 (0)