Mac v2 signing - Bug 1072722 - With older clients the new maintenance service checks the updated directory's updater.exe when verifying the updater.exe for replace requests. r=spohl
authorRobert Strong <robert.bugzilla@gmail.com>
Wed, 24 Sep 2014 23:36:43 -0700
changeset 491281 2050a94fd07e5bc02b8ce1246a51e33535d5136a
parent 491280 65326ac33f2570ba0a61808b57b031d6f66a42d2
child 491282 4f72efdd35d70c48b3452c6017debb8d5b5cc1ff
push id47343
push userbmo:dothayer@mozilla.com
push dateWed, 01 Mar 2017 22:58:58 +0000
reviewersspohl
bugs1072722
milestone35.0a1
Mac v2 signing - Bug 1072722 - With older clients the new maintenance service checks the updated directory's updater.exe when verifying the updater.exe for replace requests. r=spohl
toolkit/components/maintenanceservice/workmonitor.cpp
--- a/toolkit/components/maintenanceservice/workmonitor.cpp
+++ b/toolkit/components/maintenanceservice/workmonitor.cpp
@@ -120,18 +120,17 @@ IsDigits(WCHAR *str)
  * @param argv    The argv value normally sent to updater.exe
  * @param boolean True if the command line contains just the directory to apply
  *                the update to
  */
 static bool
 IsOldCommandline(int argc, LPWSTR *argv)
 {
   return argc == 4 && !wcscmp(argv[3], L"-1") ||
-         !wcscmp(argv[3], L"0/replace") ||
-         IsDigits(argv[3]);
+         argc >= 4 && (wcsstr(argv[3], L"/replace") || IsDigits(argv[3]));
 }
 
 /**
  * Gets the installation directory from the arguments passed to updater.exe.
  *
  * @param argcTmp    The argc value normally sent to updater.exe
  * @param argvTmp    The argv value normally sent to updater.exe
  * @param aResultDir Buffer to hold the installation directory.
@@ -406,17 +405,18 @@ ProcessSoftwareUpdateCommand(DWORD argc,
   if (result && !VerifySameFiles(argv[0], installDirUpdater,
                                  updaterIsCorrect)) {
     LOG_WARN(("Error checking if the updaters are the same.\n"
               "Path 1: %ls\nPath 2: %ls", argv[0], installDirUpdater));
     result = FALSE;
   }
 
   if (result && !updaterIsCorrect) {
-    LOG_WARN(("The updaters do not match, updater will not run."));
+    LOG_WARN(("The updaters do not match, updater will not run.\n"
+              "Path 1: %ls\nPath 2: %ls", argv[0], installDirUpdater));
     result = FALSE;
   }
 
   if (result) {
     LOG(("updater.exe was compared successfully to the installation directory"
          " updater.exe."));
   } else {
     if (!WriteStatusFailure(argv[1],