Bug 1641141 - Port bug 1466532: Drop nsIFile::followLinks. r=mkmelin, a=me
authorRichard Marti <richard.marti@gmail.com>
Wed, 27 May 2020 09:53:58 +0300
changeset 39238 f9100b280c343feefea96022d38d10251d06e4ea
parent 39237 b5646e5ec9f3fc8e6f7bb4175a4cebf53a80d46e
child 39239 f9483cb3c96a2a0618bc2e06ce3bedde451655ed
push id402
push userclokep@gmail.com
push dateMon, 29 Jun 2020 20:48:04 +0000
reviewersmkmelin, me
bugs1641141, 1466532
Bug 1641141 - Port bug 1466532: Drop nsIFile::followLinks. r=mkmelin, a=me
mailnews/base/src/nsMsgFolderCompactor.cpp
--- a/mailnews/base/src/nsMsgFolderCompactor.cpp
+++ b/mailnews/base/src/nsMsgFolderCompactor.cpp
@@ -321,19 +321,16 @@ nsresult nsFolderCompactState::Init(nsIM
                                     nsIFile *path, nsIMsgWindow *aMsgWindow) {
   nsresult rv;
 
   m_folder = folder;
   m_baseMessageUri = baseMsgUri;
   m_file = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   m_file->InitWithFile(path);
-  // need to make sure the temp file goes in the same real directory
-  // as the original file, so resolve sym links.
-  m_file->SetFollowLinks(true);
 
   m_file->SetNativeLeafName(NS_LITERAL_CSTRING("nstmp"));
   // Make sure we are not crunching existing nstmp file.
   rv = m_file->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 00600);
   NS_ENSURE_SUCCESS(rv, rv);
 
   m_window = aMsgWindow;
   m_keyArray = new nsMsgKeyArray;
@@ -438,19 +435,16 @@ nsresult nsFolderCompactState::FinishCom
 
   // get leaf name and database name of the folder
   nsresult rv = m_folder->GetFilePath(getter_AddRefs(path));
   nsCOMPtr<nsIFile> folderPath =
       do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = folderPath->InitWithFile(path);
   NS_ENSURE_SUCCESS(rv, rv);
-  // need to make sure we put the .msf file in the same directory
-  // as the original mailbox, so resolve symlinks.
-  folderPath->SetFollowLinks(true);
 
   nsCOMPtr<nsIFile> oldSummaryFile;
   rv = GetSummaryFileLocation(folderPath, getter_AddRefs(oldSummaryFile));
   NS_ENSURE_SUCCESS(rv, rv);
   nsAutoCString dbName;
   oldSummaryFile->GetNativeLeafName(dbName);
   nsAutoCString folderName;
   path->GetNativeLeafName(folderName);