[git] GpgOL - branch, master, updated. gpgol-2.3.0-52-gdf9b3ca

by Andre Heinecke cvs at cvs.gnupg.org
Tue Sep 25 14:11:44 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  df9b3ca85d7f9702f268cef46c276a89b6e14e4f (commit)
       via  c715ef5d048868786cd9a32018c58aa8225ba6e0 (commit)
       via  546cdcec1a3506ae0bdddb09dc7dd1492c094c4d (commit)
      from  38f9d070bf8e32cff85c85657e9c0c86fbb66e85 (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 df9b3ca85d7f9702f268cef46c276a89b6e14e4f
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Tue Sep 25 14:07:01 2018 +0200

    Further simplyify log level values
    
    --
    As we only have 4 levels now remove the others and
    only keep their values around for compatibility.

diff --git a/src/debug.h b/src/debug.h
index 62ce37b..7b089ce 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -49,18 +49,11 @@ extern "C" {
    544 -> OOM and Memory.
    800 -> Full debugging.
    */
-#define DBG_MEMORY         (1<<5) // 32
-#define DBG_MIME_PARSER    (1<<7) // 128 Unified as DBG_DATA
-#define DBG_MIME_DATA      (1<<8) // 256 Unified as DBG_DATA
-#define DBG_DATA           (DBG_MIME_PARSER | DBG_MIME_DATA)
-#define DBG_OOM_VAL        (1<<9) // 512 Unified as DBG_OOM
-#define DBG_OOM_EXTRA      (1<<10)// 1024 Unified as DBG_OOM
-#define DBG_TRACE          (1<<11)// 2048 Very verbose tracing.
-#define DBG_OOM            (DBG_OOM_VAL | DBG_OOM_EXTRA)
-
-#define debug_oom        ((opt.enable_debug & DBG_OOM) || \
-                          (opt.enable_debug & DBG_OOM_EXTRA))
-#define debug_oom_extra  (opt.enable_debug & DBG_OOM_EXTRA)
+#define DBG_OOM            (1<<1) // 2
+#define DBG_MEMORY         (1<<2) // 4
+#define DBG_TRACE          (1<<3) // 8
+#define DBG_DATA           (1<<4) // 16
+
 void log_debug (const char *fmt, ...) __attribute__ ((format (printf,1,2)));
 void log_error (const char *fmt, ...) __attribute__ ((format (printf,1,2)));
 void log_vdebug (const char *fmt, va_list a);
diff --git a/src/eventsink.h b/src/eventsink.h
index 12b1b35..c5a58da 100644
--- a/src/eventsink.h
+++ b/src/eventsink.h
@@ -45,7 +45,7 @@ class subcls : public parentcls                                          \
   inline STDMETHODIMP_(ULONG) AddRef (void)                              \
     {                                                                    \
       ++m_ref;                                                           \
-      if (debug_oom_extra)                                               \
+      if ((opt.enable_debug & DBG_OOM))                                               \
         log_debug ("%s:" #subcls ":%s: m_ref now %lu",                   \
                    SRCNAME,__func__, m_ref);                             \
       return m_ref;                                                      \
@@ -53,7 +53,7 @@ class subcls : public parentcls                                          \
   inline STDMETHODIMP_(ULONG) Release (void)                             \
     {                                                                    \
       ULONG count = --m_ref;                                             \
-      if (debug_oom_extra)                                               \
+      if ((opt.enable_debug & DBG_OOM))                                               \
         log_debug ("%s:" #subcls ":%s: mref now %lu",                    \
                    SRCNAME,__func__,count);                              \
       if (!count)                                                        \
@@ -92,7 +92,7 @@ STDMETHODIMP subcls::Invoke (DISPID dispid, REFIID riid, LCID lcid,      \
 
 #define EVENT_SINK_DEFAULT_DTOR_CODE(subcls)                             \
 {                                                                        \
-  if (debug_oom)                                                         \
+  if ((opt.enable_debug & DBG_OOM))                                                         \
     log_debug ("%s:" #subcls ":%s: dtor", SRCNAME, __func__);            \
   if (m_pCP)                                                             \
     m_pCP->Unadvise(m_cookie);                                           \
@@ -196,7 +196,7 @@ LPDISPATCH install_ ## subcls ## _sink (LPDISPATCH object)               \
       gpgol_release (sink);                                                  \
       return NULL;                                                       \
     }                                                                    \
-  if (debug_oom)                                                         \
+  if ((opt.enable_debug & DBG_OOM))                                                         \
     log_debug ("%s:%s:%s: Advice succeeded", SRCNAME, #subcls, __func__);\
   sink->m_cookie = cookie;                                               \
   sink->m_pCP = pCP;                                                     \
@@ -210,7 +210,7 @@ void detach_ ## subcls ## _sink (LPDISPATCH obj)                         \
   HRESULT hr;                                                            \
   subcls *sink;                                                          \
                                                                          \
-  if (debug_oom_extra)                                                   \
+  if ((opt.enable_debug & DBG_OOM))                                                   \
     log_debug ("%s:%s:%s: Called", SRCNAME, #subcls, __func__);          \
   hr = gpgol_queryInterface (obj, iidcls, (void**)&sink);                \
   if (hr != S_OK || !sink)                                               \
@@ -221,13 +221,13 @@ void detach_ ## subcls ## _sink (LPDISPATCH obj)                         \
     }                                                                    \
   if (sink->m_pCP)                                                       \
     {                                                                    \
-      if (debug_oom_extra)                                               \
+      if ((opt.enable_debug & DBG_OOM))                                               \
         log_debug ("%s:%s:%s: Unadvising", SRCNAME, #subcls, __func__);  \
       hr = sink->m_pCP->Unadvise (sink->m_cookie);                       \
       if (hr != S_OK)                                                    \
         log_error ("%s:%s:%s: Unadvice failed: hr=%#lx",                 \
                    SRCNAME, #subcls, __func__, hr);                      \
-      if (debug_oom_extra)                                               \
+      if ((opt.enable_debug & DBG_OOM))                                               \
         log_debug ("%s:%s:%s: Releasing connt point",                    \
                    SRCNAME, #subcls, __func__);                          \
       gpgol_release (sink->m_pCP);                                           \
@@ -235,7 +235,7 @@ void detach_ ## subcls ## _sink (LPDISPATCH obj)                         \
     }                                                                    \
   if (sink->m_object)                                                    \
     {                                                                    \
-      if (debug_oom_extra)                                               \
+      if ((opt.enable_debug & DBG_OOM))                                               \
         log_debug ("%s:%s:%s: Releasing actual object",                  \
                    SRCNAME, #subcls, __func__);                          \
       gpgol_release (sink->m_object);                                        \
diff --git a/src/keycache.cpp b/src/keycache.cpp
index ca2a8a5..b62884b 100644
--- a/src/keycache.cpp
+++ b/src/keycache.cpp
@@ -926,7 +926,7 @@ locate_secret (const char *addr, GpgME::Protocol proto)
       if (key.isRevoked() || key.isExpired() ||
           key.isDisabled() || key.isInvalid())
         {
-          if ((opt.enable_debug & DBG_MIME_PARSER))
+          if ((opt.enable_debug & DBG_DATA))
             {
               std::stringstream ss;
               ss << key;
diff --git a/src/main.c b/src/main.c
index 987b5fd..30f22f7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -195,6 +195,57 @@ get_conf_bool (const char *name, int defaultVal)
   return ret;
 }
 
+static int
+dbg_compat (int oldval)
+{
+  // We broke the debug levels at some point
+  // This is cmpatibility code with the old
+  // levels.
+
+#define DBG_MEMORY_OLD     (1<<5) // 32
+#define DBG_MIME_PARSER_OLD (1<<7) // 128 Unified as DBG_DATA
+#define DBG_MIME_DATA_OLD   (1<<8) // 256 Unified in read_options
+#define DBG_OOM_OLD        (1<<9) // 512 Unified as DBG_OOM
+#define DBG_OOM_EXTRA_OLD  (1<<10)// 1024 Unified in read_options
+  int new_dbg = oldval;
+  if ((oldval & DBG_MEMORY_OLD))
+    {
+      new_dbg |= DBG_MEMORY;
+      new_dbg -= DBG_MEMORY_OLD;
+    }
+  if ((oldval & DBG_OOM_OLD))
+    {
+      new_dbg |= DBG_OOM;
+      new_dbg -= DBG_OOM_OLD;
+    }
+  if ((oldval & DBG_MIME_PARSER_OLD))
+    {
+      new_dbg |= DBG_DATA;
+      new_dbg -= DBG_MIME_PARSER_OLD;
+    }
+  if ((oldval & DBG_MIME_DATA_OLD))
+    {
+      new_dbg |= DBG_DATA;
+      new_dbg -= DBG_MIME_DATA_OLD;
+    }
+  if ((oldval & DBG_OOM_OLD))
+    {
+      new_dbg |= DBG_OOM;
+      new_dbg -= DBG_OOM_OLD;
+    }
+  if ((oldval & DBG_OOM_EXTRA_OLD))
+    {
+      new_dbg |= DBG_OOM;
+      new_dbg -= DBG_OOM_EXTRA_OLD;
+    }
+#undef DBG_MEMORY_OLD
+#undef DBG_MIME_PARSER_OLD
+#undef DBG_MIME_DATA_OLD
+#undef DBG_OOM_OLD
+#undef DBG_OOM_EXTRA_OLD
+  return new_dbg;
+}
+
 /* Read option settings from the Registry. */
 void
 read_options (void)
@@ -224,17 +275,20 @@ read_options (void)
               pend += strspn (pend, ", \t\n\r\f");
             }
           if (isascii (*p) && isdigit (*p))
-            opt.enable_debug |= strtoul (p, NULL, 0);
+            {
+              opt.enable_debug |= dbg_compat (strtoul (p, NULL, 0));
+
+            }
           else if (!strcmp (p, "memory"))
             opt.enable_debug |= DBG_MEMORY;
           else if (!strcmp (p, "mime-parser"))
-            opt.enable_debug |= DBG_MIME_PARSER;
+            opt.enable_debug |= DBG_DATA;
           else if (!strcmp (p, "mime-data"))
-            opt.enable_debug |= DBG_MIME_DATA;
+            opt.enable_debug |= DBG_DATA;
           else if (!strcmp (p, "oom"))
-            opt.enable_debug |= DBG_OOM_VAL;
+            opt.enable_debug |= DBG_OOM;
           else if (!strcmp (p, "oom-extra"))
-            opt.enable_debug |= DBG_OOM_EXTRA;
+            opt.enable_debug |= DBG_OOM;
           else
             log_debug ("invalid debug flag `%s' ignored", p);
         }
diff --git a/src/mimedataprovider.cpp b/src/mimedataprovider.cpp
index cf66ddf..ad09c62 100644
--- a/src/mimedataprovider.cpp
+++ b/src/mimedataprovider.cpp
@@ -578,7 +578,7 @@ MimeDataProvider::read(void *buffer, size_t size)
   log_data ("%s:%s: Reading: " SIZE_T_FORMAT "Bytes",
                  SRCNAME, __func__, size);
   ssize_t bRead = m_crypto_data.read (buffer, size);
-  if (opt.enable_debug & DBG_MIME_DATA && bRead)
+  if ((opt.enable_debug & DBG_DATA) && bRead)
     {
       std::string buf ((char *)buffer, bRead);
 
diff --git a/src/oomhelp.cpp b/src/oomhelp.cpp
index 383960c..2b84b0e 100644
--- a/src/oomhelp.cpp
+++ b/src/oomhelp.cpp
@@ -38,7 +38,7 @@ HRESULT
 gpgol_queryInterface (LPUNKNOWN pObj, REFIID riid, LPVOID FAR *ppvObj)
 {
   HRESULT ret = pObj->QueryInterface (riid, ppvObj);
-  if ((opt.enable_debug & DBG_OOM_EXTRA) && *ppvObj)
+  if ((opt.enable_debug & DBG_MEMORY) && *ppvObj)
     {
       memdbg_addRef (*ppvObj);
     }
diff --git a/src/xmalloc.h b/src/xmalloc.h
index 5385419..e302a85 100644
--- a/src/xmalloc.h
+++ b/src/xmalloc.h
@@ -30,7 +30,7 @@ extern "C" {
 /*-- common.c --*/
 #define xmalloc(VAR1) ({void *retval; \
   retval = _xmalloc(VAR1); \
-  if ((opt.enable_debug & DBG_OOM_EXTRA)) \
+  if ((opt.enable_debug & DBG_MEMORY)) \
   { \
     memdbg_alloc (retval); \
   } \
@@ -38,7 +38,7 @@ retval;})
 
 #define xcalloc(VAR1, VAR2) ({void *retval; \
   retval = _xcalloc(VAR1, VAR2); \
-  if ((opt.enable_debug & DBG_OOM_EXTRA)) \
+  if ((opt.enable_debug & DBG_MEMORY)) \
   { \
     memdbg_alloc (retval);\
   } \
@@ -46,7 +46,7 @@ retval;})
 
 #define xrealloc(VAR1, VAR2) ({void *retval; \
   retval = _xrealloc (VAR1, VAR2); \
-  if ((opt.enable_debug & DBG_OOM_EXTRA)) \
+  if ((opt.enable_debug & DBG_MEMORY)) \
   { \
     memdbg_alloc (retval);\
     memdbg_free ((void*)VAR1); \
@@ -55,7 +55,7 @@ retval;})
 
 #define xfree(VAR1) \
 { \
-  if (VAR1 && (opt.enable_debug & DBG_OOM_EXTRA) && !memdbg_free (VAR1)) \
+  if (VAR1 && (opt.enable_debug & DBG_MEMORY) && !memdbg_free (VAR1)) \
     log_debug ("%s:%s:%i %p freed here", \
                log_srcname (__FILE__), __func__, __LINE__, VAR1); \
   _xfree (VAR1); \
@@ -63,7 +63,7 @@ retval;})
 
 #define xstrdup(VAR1) ({char *retval; \
   retval = _xstrdup (VAR1); \
-  if ((opt.enable_debug & DBG_OOM_EXTRA)) \
+  if ((opt.enable_debug & DBG_MEMORY)) \
   { \
     memdbg_alloc ((void *)retval);\
   } \
@@ -71,7 +71,7 @@ retval;})
 
 #define xwcsdup(VAR1) ({wchar_t *retval; \
   retval = _xwcsdup (VAR1); \
-  if ((opt.enable_debug & DBG_OOM_EXTRA)) \
+  if ((opt.enable_debug & DBG_MEMORY)) \
   { \
     memdbg_alloc ((void *)retval);\
   } \

commit c715ef5d048868786cd9a32018c58aa8225ba6e0
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Tue Sep 25 13:23:13 2018 +0200

    Only include conversion strings for DBG_DATA
    
    * src/w32-gettext.h: Guard debug output of all strings
    also with DBG_DATA.
    
    --
    Otherwise we would have leaked private data if trace
    and dbg mem was enabled.

diff --git a/src/w32-gettext.h b/src/w32-gettext.h
index 19a7763..24c3cd0 100644
--- a/src/w32-gettext.h
+++ b/src/w32-gettext.h
@@ -73,7 +73,7 @@ char *native_to_utf8 (const char *string);
 
 #define utf8_to_wchar(VAR1) ({wchar_t *retval; \
   retval = _utf8_to_wchar (VAR1); \
-  if ((opt.enable_debug & (DBG_TRACE & DBG_MEMORY))) \
+  if ((opt.enable_debug & (DBG_TRACE & DBG_DATA & DBG_MEMORY))) \
   { \
     log_debug ("%s:%s:%i wchar_t alloc %p:%S", \
                SRCNAME, __func__, __LINE__, retval, retval); \
@@ -82,7 +82,7 @@ retval;})
 
 #define wchar_to_utf8(VAR1) ({char *retval; \
   retval = _wchar_to_utf8 (VAR1); \
-  if ((opt.enable_debug & (DBG_TRACE & DBG_MEMORY))) \
+  if ((opt.enable_debug & (DBG_TRACE & DBG_DATA & DBG_MEMORY))) \
   { \
     log_debug ("%s:%s:%i char utf8 alloc %p:%s", \
                SRCNAME, __func__, __LINE__, retval, retval); \

commit 546cdcec1a3506ae0bdddb09dc7dd1492c094c4d
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Tue Sep 25 13:22:14 2018 +0200

    Add new strings for gpgolconfig and rename
    
    * src/addin-options.cpp: Renamed gpgolgui to gpgolconfig.
    We have more then one GUI application nowadays ;-)
    * src/addin-options.cpp: Added new strings for debug config.

diff --git a/src/addin-options.cpp b/src/addin-options.cpp
index 7b56491..ac3cdc7 100644
--- a/src/addin-options.cpp
+++ b/src/addin-options.cpp
@@ -109,13 +109,42 @@ i18n_noops[] = {
     N_("Continue?"),
     /* TRANSLATORS: Part of address book key configuration dialog. */
     N_("Confirm keys"),
+    /* TRANSLATORS: Part of debugging configuration. */
+    N_("Enable Logging"),
+    N_("Default"),
+    /* TRANSLATORS: Part of debugging configuration.  The plus should
+    mean in the combo box that it is added to the above. */
+    N_("+Outlook API calls"),
+    /* TRANSLATORS: Part of debugging configuration.  The plus should
+    mean in the combo box that it is added to the above. */
+    N_("+Memory analysis"),
+    /* TRANSLATORS: Part of debugging configuration.  The plus should
+    mean in the combo box that it is added to the above. */
+    N_("+Call tracing"),
+    /* TRANSLATORS: Part of debugging configuration. */
+    N_("Log File (required):"),
+    /* TRANSLATORS: Part of debugging configuration.  This is a checkbox
+    to select if even potentially private data should be included in the
+    debug log. */
+    N_("Include Mail contents (decrypted!) and meta information."),
+    /* TRANSLATORS: Dialog title for the log file selection */
+    N_("Select log file"),
+    /* TRANSLATORS: Part of debugging configuration. */
+    N_("Log level:"),
+    /* TRANSLATORS: Part of debugging configuration. Warning shown
+       in case the highest log level is selected. Please try to
+       keep the string ~ the size of the english version as the
+       warning is shown in line with the combo box to select the
+       level. */
+    N_("<b>Warning:</b> Decreased performance. Huge logs!"),
+
 };
 
 
 static bool dlg_open;
 
 static DWORD WINAPI
-open_gpgolgui (LPVOID arg)
+open_gpgolconfig (LPVOID arg)
 {
   HWND wnd = (HWND) arg;
 
@@ -128,8 +157,8 @@ open_gpgolgui (LPVOID arg)
       TRACEPOINT;
       return -1;
     }
-  const auto gpgolgui = std::string (gpg4win_dir) + "\\bin\\gpgolgui.exe";
-  args.push_back (gpgolgui);
+  const auto gpgolconfig = std::string (gpg4win_dir) + "\\bin\\gpgolconfig.exe";
+  args.push_back (gpgolconfig);
 
   args.push_back (std::string ("--hwnd"));
   args.push_back (std::to_string ((int) (intptr_t) wnd));
@@ -184,11 +213,11 @@ options_dialog_box (HWND parent)
 
   if (dlg_open)
     {
-      log_debug ("%s:%s: Gpgolgui open. Not launching new dialog.",
+      log_debug ("%s:%s: Gpgolconfig open. Not launching new dialog.",
                  SRCNAME, __func__);
       HWND optWindow = FindWindow (nullptr, _("Configure GpgOL"));
       if (!optWindow) {
-        log_debug ("%s:%s: Gpgolgui open but could not find window.",
+        log_debug ("%s:%s: Gpgolconfig open but could not find window.",
                  SRCNAME, __func__);
         return;
       }
@@ -197,9 +226,9 @@ options_dialog_box (HWND parent)
       return;
     }
 
-  log_debug ("%s:%s: Launching gpgolgui.",
+  log_debug ("%s:%s: Launching gpgolconfig.",
              SRCNAME, __func__);
 
-  CloseHandle (CreateThread (NULL, 0, open_gpgolgui, (LPVOID) parent, 0,
+  CloseHandle (CreateThread (NULL, 0, open_gpgolconfig, (LPVOID) parent, 0,
                              NULL));
 }

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

Summary of changes:
 src/addin-options.cpp    | 43 ++++++++++++++++++++++++++------
 src/debug.h              | 17 ++++---------
 src/eventsink.h          | 16 ++++++------
 src/keycache.cpp         |  2 +-
 src/main.c               | 64 ++++++++++++++++++++++++++++++++++++++++++++----
 src/mimedataprovider.cpp |  2 +-
 src/oomhelp.cpp          |  2 +-
 src/w32-gettext.h        |  4 +--
 src/xmalloc.h            | 12 ++++-----
 9 files changed, 119 insertions(+), 43 deletions(-)


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




More information about the Gnupg-commits mailing list