[Libreoffice-commits] core.git: Branch 'feature/mar-updater' - 3 commits - desktop/source onlineupdate/source

Markus Mohrhard markus.mohrhard at googlemail.com
Sun Nov 27 23:38:51 UTC 2016


 desktop/source/app/updater.cxx                 |    9 +++++++--
 onlineupdate/source/libmar/verify/cryptox.c    |    4 ++++
 onlineupdate/source/update/updater/updater.cxx |    6 +++---
 3 files changed, 14 insertions(+), 5 deletions(-)

New commits:
commit 3027deb2278779378396622309656301effd5443
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Nov 28 00:31:48 2016 +0100

    fix more platform define checks
    
    Change-Id: I2e125770fc6c21141c45ccc057d95fada8ccf74c

diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 183ad8d9..0ca03bc 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -40,9 +40,9 @@ class error_updater : public std::exception
 
 static const char kUserAgent[] = "UpdateChecker/1.0 (Linux)";
 
-#if UNX
+#ifdef UNX
 const char* pUpdaterName = "updater";
-#elif WNT
+#elif defined(WNT)
 const char* pUpdaterName = "updater.exe";
 #else
 #error "Need implementation"
diff --git a/onlineupdate/source/libmar/verify/cryptox.c b/onlineupdate/source/libmar/verify/cryptox.c
index f71c4cef..7edf8be 100644
--- a/onlineupdate/source/libmar/verify/cryptox.c
+++ b/onlineupdate/source/libmar/verify/cryptox.c
@@ -13,8 +13,10 @@
 
 #if defined(MAR_NSS)
 
+#ifdef _WIN32
 #pragma warning(push)
 #pragma warning(disable: 4204)
+#endif
 
 /**
  * Loads the public key for the specified cert name from the NSS store.
@@ -270,7 +272,9 @@ CryptoAPI_VerifyUpdate(HCRYPTHASH* hash, BYTE *buf, DWORD len)
   return result ? CryptoX_Success : CryptoX_Error;
 }
 
+#ifdef _WIN32
 #pragma warning(pop)
+#endif
 
 #endif
 
commit 124a0d7c73334d69f8f770072d88e4a748aec4ae
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Nov 28 00:25:07 2016 +0100

    fix Wundef warnings
    
    Change-Id: I36a68731e861a58d631249e6580233102cd3b702

diff --git a/onlineupdate/source/update/updater/updater.cxx b/onlineupdate/source/update/updater/updater.cxx
index 5c8578c..828b855 100644
--- a/onlineupdate/source/update/updater/updater.cxx
+++ b/onlineupdate/source/update/updater/updater.cxx
@@ -2518,7 +2518,7 @@ int LaunchCallbackAndPostProcessApps(int argc, NS_tchar** argv,
 #ifdef _WIN32
         , const WCHAR* elevatedLockFilePath
         , HANDLE updateLockFileHandle
-#elif MACOSX
+#elif defined(MACOSX)
         , bool isElevated
 #endif
         )
@@ -2542,7 +2542,7 @@ int LaunchCallbackAndPostProcessApps(int argc, NS_tchar** argv,
             }
         }
         EXIT_WHEN_ELEVATED(elevatedLockFilePath, updateLockFileHandle, 0);
-#elif MACOSX
+#elif defined(MACOSX)
         if (!isElevated) {
             if (gSucceeded) {
                 LaunchMacPostProcess(gInstallDirPath);
@@ -3450,7 +3450,7 @@ int NS_main(int argc, NS_tchar **argv)
 #ifdef _WIN32
             , elevatedLockFilePath
             , updateLockFileHandle
-#elif XP_MACOSX
+#elif defined(MACOSX)
             , isElevated
 #endif
             );
commit e7db905a567e997166d00785386d0197d544c7a7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Nov 26 23:32:25 2016 +0100

    handle errors returned by the server
    
    Change-Id: I91808a017123501fa28cc9b7bfa7316f3d52b7df

diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index bccf677..183ad8d9 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -314,6 +314,11 @@ update_info parse_response(const std::string& rResponse)
     }
 
     auto aRootKeys = aDocumentRoot.keys();
+    if (std::find(aRootKeys.begin(), aRootKeys.end(), "error") != aRootKeys.end())
+    {
+        throw invalid_update_info();
+    }
+
     if (aRootKeys.size() != 5)
     {
         SAL_WARN("desktop.Update", "invalid root entries: " << rResponse);


More information about the Libreoffice-commits mailing list