commit d8983a79f8a0e9ae4543c229819cd17ee0e3f78a Author: Georg Koppen gk@torproject.org Date: Mon Sep 2 07:22:17 2019 +0000
Revert "Bug 1574980 - Fix issues with maintenance service install. r=bytesized a=jcristau"
We don't use the maintenance service and don't want to have parts of it now included in our updater code. This commit fixes bug 31547 for esr68. --- .../components/maintenanceservice/serviceinstall.cpp | 9 +++++++++ toolkit/mozapps/update/common/moz.build | 20 ++++++++++++++------ toolkit/mozapps/update/common/updatehelper.cpp | 9 --------- 3 files changed, 23 insertions(+), 15 deletions(-)
diff --git a/toolkit/components/maintenanceservice/serviceinstall.cpp b/toolkit/components/maintenanceservice/serviceinstall.cpp index eb02422fadfe..ae91b1b41b76 100644 --- a/toolkit/components/maintenanceservice/serviceinstall.cpp +++ b/toolkit/components/maintenanceservice/serviceinstall.cpp @@ -246,6 +246,15 @@ BOOL FixServicePath(SC_HANDLE service, LPCWSTR currentServicePath, * @return TRUE if the service was installed/upgraded */ BOOL SvcInstall(SvcInstallAction action) { + mozilla::UniquePtr<wchar_t[]> updateDir; + HRESULT permResult = GetCommonUpdateDirectory( + nullptr, SetPermissionsOf::FilesAndDirsWithBadPerms, updateDir); + if (FAILED(permResult)) { + LOG_WARN( + ("Unable to set the permissions on the update directory ('%S'): %d", + updateDir.get(), permResult)); + } + // Get a handle to the local computer SCM database with full access rights. nsAutoServiceHandle schSCManager( OpenSCManager(nullptr, nullptr, SC_MANAGER_ALL_ACCESS)); diff --git a/toolkit/mozapps/update/common/moz.build b/toolkit/mozapps/update/common/moz.build index 36aae9d6015b..c95f8395e853 100644 --- a/toolkit/mozapps/update/common/moz.build +++ b/toolkit/mozapps/update/common/moz.build @@ -14,14 +14,17 @@ EXPORTS += [
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': EXPORTS += [ - 'certificatecheck.h', 'pathhash.h', - 'registrycertificates.h', 'uachelper.h', 'updatehelper.cpp', 'updatehelper.h', 'updateutils_win.h', ] + if CONFIG['MOZ_MAINTENANCE_SERVICE']: + EXPORTS += [ + 'certificatecheck.h', + 'registrycertificates.h', + ]
Library('updatecommon')
@@ -32,21 +35,26 @@ DisableStlWrapping()
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': SOURCES += [ - 'certificatecheck.cpp', 'pathhash.cpp', - 'registrycertificates.cpp', 'uachelper.cpp', 'updatehelper.cpp', 'updateutils_win.cpp', ] OS_LIBS += [ 'advapi32', - 'crypt32', 'ole32', 'rpcrt4', 'shell32', - 'wintrust', ] + if CONFIG['MOZ_MAINTENANCE_SERVICE']: + SOURCES += [ + 'certificatecheck.cpp', + 'registrycertificates.cpp', + ] + OS_LIBS += [ + 'crypt32', + 'wintrust', + ]
SOURCES += [ '/other-licenses/nsis/Contrib/CityHash/cityhash/city.cpp', diff --git a/toolkit/mozapps/update/common/updatehelper.cpp b/toolkit/mozapps/update/common/updatehelper.cpp index df14fafc51e9..d51813527d62 100644 --- a/toolkit/mozapps/update/common/updatehelper.cpp +++ b/toolkit/mozapps/update/common/updatehelper.cpp @@ -12,7 +12,6 @@ # include "mozilla/UniquePtr.h" # include "pathhash.h" # include "shlobj.h" -# include "registrycertificates.h" # include "uachelper.h" # include "updatehelper.h" # include "updateutils_win.h" @@ -123,14 +122,6 @@ BOOL StartServiceUpdate(LPCWSTR installDir) { return FALSE; }
- // Check that the copied file's certificate matches the expected name and - // issuer stored in the registry for this installation and that the - // certificate is trusted by the system's certificate store. - if (!DoesBinaryMatchAllowedCertificates(installDir, tmpService)) { - DeleteFileW(tmpService); - return FALSE; - } - // Start the upgrade comparison process STARTUPINFOW si = {0}; si.cb = sizeof(STARTUPINFOW);
tor-commits@lists.torproject.org