commit 58b56abbc7c2e7d11861164c5be439fe08966c12
parent 788f92bc8b85d9d5b4ebc8e4cc5863ea93f57885
Author: Dan Stillman <dstillman@zotero.org>
Date: Fri, 3 Apr 2015 23:59:32 -0400
Fix file sync errors with symlinked files/directories
nsIFile seems to have figured out symlinks since Firefox 3.0.1
Diffstat:
1 file changed, 1 insertion(+), 22 deletions(-)
diff --git 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);