From 58b56abbc7c2e7d11861164c5be439fe08966c12 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 3 Apr 2015 23:59:32 -0400 Subject: [PATCH] Fix file sync errors with symlinked files/directories nsIFile seems to have figured out symlinks since Firefox 3.0.1 --- chrome/content/zotero/xpcom/storage.js | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index 24a6a4c186..eb259f84ee 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -1734,16 +1734,6 @@ Zotero.Sync.Storage = new function () { Zotero.File.checkFileAccessError(e, destFile, 'create'); } - var origPath = destFile.path; - var origFileName = destFile.leafName; - destFile.normalize(); - if (origPath != destFile.path) { - var msg = "ZIP file " + zipFile.leafName + " contained symlink '" - + origFileName + "'"; - Zotero.debug(msg, 1); - Components.utils.reportError(msg + " in " + funcName); - continue; - } destFile.permissions = 0644; // If we're renaming the main file, processDownload() needs to know @@ -1773,18 +1763,7 @@ Zotero.Sync.Storage = new function () { continue; } - // Firefox (as of 3.0.1) can't detect symlinks (at least on OS X), - // so use pre/post-normalized path to check - var origPath = file.path; - var origFileName = file.leafName; - file.normalize(); - if (origPath != file.path) { - var msg = "Not deleting symlink '" + origFileName + "'"; - Zotero.debug(msg, 2); - Components.utils.reportError(msg + " in " + funcName); - continue; - } - // This should be redundant with above check, but let's do it anyway + // Check symlink awareness, just to be safe if (!parentDir.contains(file, false)) { var msg = "Storage directory doesn't contain '" + file.leafName + "'"; Zotero.debug(msg, 2);