#4 Fix posix_spawn avoided issue using a patch from upstream git (RH #1645897)
Closed 4 years ago by amatej. Opened 5 years ago by belegdol.
Unknown source posix_spawn_avoided_fix  into  master

@@ -0,0 +1,66 @@

+ From 364bbb2ec911ba96005b136df513631b0d5a95f5 Mon Sep 17 00:00:00 2001

+ From: Jaroslav Rohel <jrohel@redhat.com>

+ Date: Fri, 9 Nov 2018 07:35:13 +0100

+ Subject: [PATCH] Fix setup of logging (log domains) (RhBug:1645897)

+ 

+ New debug messages were added into GLib library. These messages come

+ from the "GLib" log domain and were not hidden in the standard and

+ quiet mode of the application.

+ This fix hides log messages regardless on source log domain.

+ ---

+  src/createrepo_shared.c | 19 ++++++-------------

+  src/misc.c              |  5 ++++-

+  2 files changed, 10 insertions(+), 14 deletions(-)

+ 

+ diff --git a/src/createrepo_shared.c b/src/createrepo_shared.c

+ index 8a26787..7cb8ba8 100644

+ --- a/src/createrepo_shared.c

+ +++ b/src/createrepo_shared.c

+ @@ -270,24 +270,17 @@ cr_lock_repo(const gchar *repo_dir,

+  void

+  cr_setup_logging(gboolean quiet, gboolean verbose)

+  {

+ -    g_log_set_default_handler (cr_log_fn, NULL);

+ -

+      if (quiet) {

+          // Quiet mode

+ -        GLogLevelFlags levels = G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_INFO |

+ -                                G_LOG_LEVEL_DEBUG | G_LOG_LEVEL_WARNING;

+ -        g_log_set_handler(NULL, levels, cr_null_log_fn, NULL);

+ -        g_log_set_handler("C_CREATEREPOLIB", levels, cr_null_log_fn, NULL);

+ +        GLogLevelFlags hidden_levels = G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_INFO |

+ +                                       G_LOG_LEVEL_DEBUG | G_LOG_LEVEL_WARNING;

+ +        g_log_set_default_handler (cr_log_fn, GINT_TO_POINTER(hidden_levels));

+      } else if (verbose) {

+          // Verbose mode

+ -        GLogLevelFlags levels = G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_INFO |

+ -                                G_LOG_LEVEL_DEBUG | G_LOG_LEVEL_WARNING;

+ -        g_log_set_handler(NULL, levels, cr_log_fn, NULL);

+ -        g_log_set_handler("C_CREATEREPOLIB", levels, cr_log_fn, NULL);

+ +        g_log_set_default_handler (cr_log_fn, GINT_TO_POINTER(0));

+      } else {

+          // Standard mode

+ -        GLogLevelFlags levels = G_LOG_LEVEL_DEBUG;

+ -        g_log_set_handler(NULL, levels, cr_null_log_fn, NULL);

+ -        g_log_set_handler("C_CREATEREPOLIB", levels, cr_null_log_fn, NULL);

+ +        GLogLevelFlags hidden_levels = G_LOG_LEVEL_DEBUG;

+ +        g_log_set_default_handler (cr_log_fn, GINT_TO_POINTER(hidden_levels));

+      }

+  }

+ diff --git a/src/misc.c b/src/misc.c

+ index 9937480..9549a44 100644

+ --- a/src/misc.c

+ +++ b/src/misc.c

+ @@ -912,8 +912,11 @@ void

+  cr_log_fn(const gchar *log_domain,

+            GLogLevelFlags log_level,

+            const gchar *message,

+ -          G_GNUC_UNUSED gpointer user_data)

+ +          gpointer user_data)

+  {

+ +    gint hidden_log_levels = GPOINTER_TO_INT(user_data);

+ +    if (log_level & hidden_log_levels)

+ +        return;

+      switch(log_level) {

+          case G_LOG_LEVEL_ERROR:

+              if (log_domain) g_printerr("%s: ", log_domain);

file modified
+5 -1
@@ -22,10 +22,11 @@

  Summary:        Creates a common metadata repository

  Name:           createrepo_c

  Version:        0.11.1

- Release:        2%{?dist}

+ Release:        3%{?dist}

  License:        GPLv2+

  URL:            https://github.com/rpm-software-management/createrepo_c

  Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz

+ Patch0:         364bbb2ec911ba96005b136df513631b0d5a95f5.patch

  

  BuildRequires:  cmake

  BuildRequires:  gcc
@@ -224,6 +225,9 @@

  %endif

  

  %changelog

+ * Wed Nov 28 2018 Julian Sikorski <belegdol@fedoraproject.org> - 0.11.1-3

+ - Fix posix_spawn avoided issue using a patch from upstream git (RH #1645897)

+ 

  * Mon Nov 26 2018 Miro Hrončok <mhroncok@redhat.com> - 0.11.1-2

  - Drop Python 2 subpackage on Fedora 30 (#1651182)

  

Is there a reason this pull request is being ignored? I'm trying to do test builds of OpenImageIO 2.0 and I need mockchain in order to do test builds of all dependencies.

Changes in this patch are already part of upstream and also were released.

Pull-Request has been closed by amatej

4 years ago