[git] GpgOL - branch, master, updated. gpgol-2.1.1-2-g8635193

by Andre Heinecke cvs at cvs.gnupg.org
Fri Apr 27 08:49:04 CEST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".

The branch, master has been updated
       via  8635193d010812d0bff2ee64e6c8e47f1ef43164 (commit)
      from  d62eb617a31ea1c579597c23e3cb872e3f42e8a2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8635193d010812d0bff2ee64e6c8e47f1ef43164
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Apr 27 08:29:13 2018 +0200

    Disable OL 2013 / 2016 resiliency for us
    
    * src/gpgoladdin.cpp (setupDoNotDisable): New.
    (addGpgOLToReg): New helper.
    
    --
    While this should not be necessrary if we don't crash, well
    in the real world it happens and then users have the problem
    that they have to manually renable GpgOL and report it
    as an issue.
    
    With this GpgOL should no longer be disabled in Outlook
    2013 and 2016. 2010 does not have this auto disable.
    
    GnuPG-Bug-Id: T3938

diff --git a/src/gpgoladdin.cpp b/src/gpgoladdin.cpp
index 6f393ca..6525598 100644
--- a/src/gpgoladdin.cpp
+++ b/src/gpgoladdin.cpp
@@ -246,6 +246,77 @@ GpgolAddin::QueryInterface (REFIID riid, LPVOID* ppvObj)
   return hr;
 }
 
+static void
+addGpgOLToReg (const std::string &path)
+{
+  HKEY h;
+  int err = RegOpenKeyEx (HKEY_CURRENT_USER, path.c_str(), 0,
+                          KEY_ALL_ACCESS, &h);
+  if (err != ERROR_SUCCESS)
+    {
+      log_debug ("%s:%s: no DoNotDisableAddinList entry '%s' creating it",
+                 SRCNAME, __func__, path.c_str ());
+      err = RegCreateKeyEx (HKEY_CURRENT_USER, path.c_str (), 0, NULL,
+                            REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL,
+                            &h, NULL);
+    }
+  if (err != ERROR_SUCCESS)
+    {
+      log_error ("%s:%s: failed to create key.",
+                 SRCNAME, __func__);
+      return;
+    }
+
+  DWORD type;
+  err = RegQueryValueEx (h, GPGOL_PROGID, NULL, &type, NULL, NULL);
+  if (err == ERROR_SUCCESS)
+    {
+      log_debug ("%s:%s: Found gpgol reg key. Leaving it unchanged.",
+                 SRCNAME, __func__);
+      RegCloseKey (h);
+      return;
+    }
+
+  // No key exists. Create one.
+  DWORD dwTemp = 1;
+  err = RegSetValueEx (h, GPGOL_PROGID, 0, REG_DWORD, (BYTE*)&dwTemp, 4);
+  RegCloseKey (h);
+
+  if (err != ERROR_SUCCESS)
+    {
+      log_error ("%s:%s: failed to set registry value.",
+                 SRCNAME, __func__);
+    }
+  else
+    {
+      log_debug ("%s:%s: added gpgol to %s",
+                 SRCNAME, __func__, path.c_str ());
+    }
+}
+
+/* This is a bit evil as we basically disable outlooks resiliency
+   for us. But users are still able to manually disable the addon
+   or change the donotdisable setting to zero and we won't change
+   it.
+
+   It has been much requested by users that we do this automatically.
+*/
+static void
+setupDoNotDisable ()
+{
+  std::string path = "Software\\Microsoft\\Office\\";
+  path += std::to_string (g_ol_version_major);
+  path += ".0\\Outlook\\Resiliency\\DoNotDisableAddinList";
+
+  addGpgOLToReg (path);
+
+  path = "Software\\Microsoft\\Office\\";
+  path += std::to_string (g_ol_version_major);
+  path += ".0\\Outlook\\Resiliency\\AddinList";
+
+  addGpgOLToReg (path);
+}
+
 STDMETHODIMP
 GpgolAddin::OnConnection (LPDISPATCH Application, ext_ConnectMode ConnectMode,
                           LPDISPATCH AddInInst, SAFEARRAY ** custom)
@@ -284,6 +355,8 @@ GpgolAddin::OnConnection (LPDISPATCH Application, ext_ConnectMode ConnectMode,
     }
   engine_init ();
 
+  setupDoNotDisable ();
+
   if (ConnectMode != ext_cm_Startup)
     {
       OnStartupComplete (custom);

-----------------------------------------------------------------------

Summary of changes:
 src/gpgoladdin.cpp | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)


hooks/post-receive
-- 
GnuPG extension for MS Outlook
http://git.gnupg.org




More information about the Gnupg-commits mailing list