Bug 748764 - r=rstrong, a=akeybl
authorBrian R. Bondy <netzen@gmail.com>
Wed, 02 May 2012 15:40:28 -0400
changeset 92168 b906d4ad61245343a9ebbb678f22c2ea2ecb5e41
parent 92167 517b484c48e0a1365e62705a91f2385bf38a061c
child 92169 023b3a0e655b33e066af547964f9b9b88d9b8b9c
push idunknown
push userunknown
push dateunknown
reviewersrstrong, akeybl
bugs748764
milestone13.0
Bug 748764 - r=rstrong, a=akeybl
toolkit/components/maintenanceservice/serviceinstall.cpp
toolkit/components/maintenanceservice/workmonitor.cpp
--- a/toolkit/components/maintenanceservice/serviceinstall.cpp
+++ b/toolkit/components/maintenanceservice/serviceinstall.cpp
@@ -399,16 +399,18 @@ SvcInstall(SvcInstallAction action)
   }
   
   // If the service does not exist and we are upgrading, don't install it.
   if (UpgradeSvc == action) {
     // The service does not exist and we are upgrading, so don't install it
     return TRUE;
   }
 
+  // Quote the path only if it contains spaces.
+  PathQuoteSpaces(newServiceBinaryPath);
   // The service does not already exist so create the service as on demand
   schService.own(CreateServiceW(schSCManager, SVC_NAME, SVC_DISPLAY_NAME,
                                 SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS,
                                 SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL,
                                 newServiceBinaryPath, NULL, NULL, NULL, 
                                 NULL, NULL));
   if (!schService) {
     LOG(("Could not create Windows service. "
--- a/toolkit/components/maintenanceservice/workmonitor.cpp
+++ b/toolkit/components/maintenanceservice/workmonitor.cpp
@@ -321,17 +321,18 @@ ProcessSoftwareUpdateCommand(DWORD argc,
       LOG(("Could not write update.status updater compare failure.\n"));
     }
     return FALSE;
   }
 
   // Check to make sure the udpater.exe module has the unique updater identity.
   // This is a security measure to make sure that the signed executable that
   // we will run is actually an updater.
-  HMODULE updaterModule = LoadLibrary(argv[0]);
+  HMODULE updaterModule = LoadLibraryEx(argv[0], NULL, 
+                                        LOAD_LIBRARY_AS_DATAFILE);
   if (!updaterModule) {
     LOG(("updater.exe module could not be loaded. (%d)\n", GetLastError()));
     result = FALSE;
   } else {
     char updaterIdentity[64];
     if (!LoadStringA(updaterModule, IDS_UPDATER_IDENTITY, 
                      updaterIdentity, sizeof(updaterIdentity))) {
       LOG(("The updater.exe application does not contain the Mozilla"