[abrt] build fixes + few forgotten patches

Jiří Moskovčák jmoskovc at fedoraproject.org
Wed Dec 7 15:38:34 UTC 2011


commit 891ef46da3ca455785b3e1371d8f118d1f9b0d84
Author: Jiri <moskovcak at gmail.com>
Date:   Wed Dec 7 16:38:32 2011 +0100

    build fixes + few forgotten patches

 0002-disabled-reporting-to-kerneloops.org.patch    |    2 +-
 ...otential-problem-with-exitcode-check-on-p.patch |   90 ++++++++++++++++++++
 ...s-explain-why-we-delete-corrupted-dir.-Cl.patch |   47 ++++++++++
 0005-more-glib2.31-fixes.patch                     |   48 +++++++++++
 ...sed-one-more-deprecated-g_io_channel_read.patch |   25 ++++++
 abrt.spec                                          |   12 ++-
 6 files changed, 221 insertions(+), 3 deletions(-)
---
diff --git a/0002-disabled-reporting-to-kerneloops.org.patch b/0002-disabled-reporting-to-kerneloops.org.patch
index 3c46ec8..e46bc7f 100644
--- a/0002-disabled-reporting-to-kerneloops.org.patch
+++ b/0002-disabled-reporting-to-kerneloops.org.patch
@@ -1,7 +1,7 @@
 From 3e39d5b9944536a6f4d4f266b3c4961ad8da443e Mon Sep 17 00:00:00 2001
 From: Jiri <moskovcak at gmail.com>
 Date: Wed, 7 Dec 2011 10:34:27 +0100
-Subject: [PATCH 2/2] disabled reporting to kerneloops.org
+Subject: [PATCH 2/5] disabled reporting to kerneloops.org
 
 - we get lot of complains about dead kerneloops.org and since it's
   not wihtin our power to fix it -> disable it!
diff --git a/0003-abrtd-fix-potential-problem-with-exitcode-check-on-p.patch b/0003-abrtd-fix-potential-problem-with-exitcode-check-on-p.patch
new file mode 100644
index 0000000..2a9dceb
--- /dev/null
+++ b/0003-abrtd-fix-potential-problem-with-exitcode-check-on-p.patch
@@ -0,0 +1,90 @@
+From c138894ba3f3e630d7e1af398fcd93ffa862659d Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <dvlasenk at redhat.com>
+Date: Wed, 7 Dec 2011 13:58:25 +0100
+Subject: [PATCH 3/5] abrtd: fix potential problem with exitcode check on
+ "post-create"
+
+Signed-off-by: Denys Vlasenko <dvlasenk at redhat.com>
+---
+ src/daemon/abrtd.c |   53 ++++++++++++++++++++++++++-------------------------
+ 1 files changed, 27 insertions(+), 26 deletions(-)
+
+diff --git a/src/daemon/abrtd.c b/src/daemon/abrtd.c
+index d3a759a..743e40f 100644
+--- a/src/daemon/abrtd.c
++++ b/src/daemon/abrtd.c
+@@ -313,9 +313,10 @@ static mw_result_t run_post_create_and_load_data(const char *dump_dir_name, prob
+     /* Prevent having zombie child process */
+     int status;
+     safe_waitpid(child, &status, 0);
+-    status = WEXITSTATUS(status);
++    /* status = WEXITSTATUS(status); - wrong, we need to check WIFEXITED too */
+ 
+-    /* exit 0 means, this is a good, non-dup dir */
++    /* exit 0 means "this is a good, non-dup dir" */
++    /* exit with 1 + "DUP_OF_DIR: dir" string => dup */
+     if (status != 0)
+     {
+         if (!dup_of_dir)
+@@ -330,34 +331,34 @@ static mw_result_t run_post_create_and_load_data(const char *dump_dir_name, prob
+      * else: MW_ERROR
+      */
+     mw_result_t res = MW_ERROR;
++    struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
++    if (!dd)
++        /* dd_opendir already emitted error msg */
++        goto ret;
++
++    /* Reset mode/uig/gid to correct values for all files created by event run */
++    dd_sanitize_mode_and_owner(dd);
++
++    /* Update count */
++    char *count_str = dd_load_text_ext(dd, FILENAME_COUNT, DD_FAIL_QUIETLY_ENOENT);
++    unsigned long count = strtoul(count_str, NULL, 10);
++    count++;
++    char new_count_str[sizeof(long)*3 + 2];
++    sprintf(new_count_str, "%lu", count);
++    dd_save_text(dd, FILENAME_COUNT, new_count_str);
++    dd_close(dd);
++
++    *problem_data = load_problem_data(dump_dir_name);
++    if (*problem_data != NULL)
+     {
+-        struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
+-        if (!dd)
+-            goto ret;
+-
+-        /* Reset mode/uig/gid to correct values for all files created by event run */
+-        dd_sanitize_mode_and_owner(dd);
+-
+-        /* Update count */
+-        char *count_str = dd_load_text_ext(dd, FILENAME_COUNT, DD_FAIL_QUIETLY_ENOENT);
+-        unsigned long count = strtoul(count_str, NULL, 10);
+-        count++;
+-        char new_count_str[sizeof(long)*3 + 2];
+-        sprintf(new_count_str, "%lu", count);
+-        dd_save_text(dd, FILENAME_COUNT, new_count_str);
+-        dd_close(dd);
+-
+-        *problem_data = load_problem_data(dump_dir_name);
+-        if (*problem_data != NULL)
++        res = MW_OK;
++        if (count > 1)
+         {
+-            res = MW_OK;
+-            if (count > 1)
+-            {
+-                log("Problem directory is a duplicate of %s", dump_dir_name);
+-                res = MW_OCCURRED;
+-            }
++            log("Problem directory is a duplicate of %s", dump_dir_name);
++            res = MW_OCCURRED;
+         }
+     }
++    /* else: load_problem_data already emitted error msg */
+ 
+  ret:
+     free(dup_of_dir);
+-- 
+1.7.7.3
+
diff --git a/0004-abrtd-always-explain-why-we-delete-corrupted-dir.-Cl.patch b/0004-abrtd-always-explain-why-we-delete-corrupted-dir.-Cl.patch
new file mode 100644
index 0000000..5268fe6
--- /dev/null
+++ b/0004-abrtd-always-explain-why-we-delete-corrupted-dir.-Cl.patch
@@ -0,0 +1,47 @@
+From 26a0f776d32d0d5be2e15abe781adf5a830c24cc Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <dvlasenk at redhat.com>
+Date: Wed, 7 Dec 2011 14:14:56 +0100
+Subject: [PATCH 4/5] abrtd: always explain why we delete "corrupted" dir.
+ Closes rhbz#706131.
+
+We were almost always explaining it, except for the case when
+'post-create' was failing silently.
+
+Signed-off-by: Denys Vlasenko <dvlasenk at redhat.com>
+---
+ src/daemon/abrtd.c |   12 +++++++++++-
+ 1 files changed, 11 insertions(+), 1 deletions(-)
+
+diff --git a/src/daemon/abrtd.c b/src/daemon/abrtd.c
+index 743e40f..b5c3d4b 100644
+--- a/src/daemon/abrtd.c
++++ b/src/daemon/abrtd.c
+@@ -313,14 +313,24 @@ static mw_result_t run_post_create_and_load_data(const char *dump_dir_name, prob
+     /* Prevent having zombie child process */
+     int status;
+     safe_waitpid(child, &status, 0);
+-    /* status = WEXITSTATUS(status); - wrong, we need to check WIFEXITED too */
+ 
+     /* exit 0 means "this is a good, non-dup dir" */
+     /* exit with 1 + "DUP_OF_DIR: dir" string => dup */
+     if (status != 0)
+     {
++        if (WIFSIGNALED(status))
++        {
++            log("'post-create' on '%s' killed by signal %d",
++                            dump_dir_name, WTERMSIG(status));
++            return MW_ERROR;
++        }
++        /* else: it is WIFEXITED(status) */
+         if (!dup_of_dir)
++        {
++            log("'post-create' on '%s' exited with %d",
++                            dump_dir_name, WEXITSTATUS(status));
+             return MW_ERROR;
++        }
+         dump_dir_name = dup_of_dir;
+     }
+ 
+-- 
+1.7.7.3
+
diff --git a/0005-more-glib2.31-fixes.patch b/0005-more-glib2.31-fixes.patch
new file mode 100644
index 0000000..14c085a
--- /dev/null
+++ b/0005-more-glib2.31-fixes.patch
@@ -0,0 +1,48 @@
+From 2e941ae3c1d13968bda8bb4594a5aa566aa2e5dd Mon Sep 17 00:00:00 2001
+From: Jiri Moskovcak <jmoskovc at redhat.com>
+Date: Wed, 7 Dec 2011 16:12:28 +0100
+Subject: [PATCH 5/5] more glib2.31 fixes
+
+---
+ src/daemon/abrtd.c |   17 +++++++++++++----
+ 1 files changed, 13 insertions(+), 4 deletions(-)
+
+diff --git a/src/daemon/abrtd.c b/src/daemon/abrtd.c
+index d3a759a..3d71e80 100644
+--- a/src/daemon/abrtd.c
++++ b/src/daemon/abrtd.c
+@@ -238,7 +238,7 @@ static gboolean handle_signal_cb(GIOChannel *gio, GIOCondition condition, gpoint
+ {
+     uint8_t signo;
+     gsize len = 0;
+-    g_io_channel_read(gio, (void*) &signo, 1, &len);
++    g_io_channel_read_chars(gio, (void*) &signo, 1, &len, NULL);
+     if (len == 1)
+     {
+         /* we did receive a signal */
+@@ -382,10 +382,19 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition condition, gpoin
+     char *buf = (char*)xmalloc(inotify_bytes);
+     errno = 0;
+     gsize len;
+-    GIOError err = g_io_channel_read(gio, buf, inotify_bytes, &len);
+-    if (err != G_IO_ERROR_NONE)
++    GError *gerror = NULL;
++    g_io_channel_set_encoding(gio, NULL, &gerror);
++    /* need to set the encoding otherwise we get:
++     * Invalid byte sequence in conversion input
++     * according to manual "NULL" is safe for binary data
++    */
++    if (gerror)
++        perror_msg("Can't set encoding on gio channel: '%s'", gerror->message);
++
++    GIOStatus err = g_io_channel_read_chars(gio, buf, inotify_bytes, &len, &gerror);
++    if (err != G_IO_STATUS_NORMAL)
+     {
+-        perror_msg("Error reading inotify fd");
++        perror_msg("Error reading inotify fd: %s", gerror ? gerror->message : "unknown");
+         free(buf);
+         return FALSE; /* "remove this event" (huh??) */
+     }
+-- 
+1.7.7.3
+
diff --git a/0006-missed-one-more-deprecated-g_io_channel_read.patch b/0006-missed-one-more-deprecated-g_io_channel_read.patch
new file mode 100644
index 0000000..538cffd
--- /dev/null
+++ b/0006-missed-one-more-deprecated-g_io_channel_read.patch
@@ -0,0 +1,25 @@
+From 7b937c6322c3130d9801596b93866a5e72a6da64 Mon Sep 17 00:00:00 2001
+From: Jiri Moskovcak <jmoskovc at redhat.com>
+Date: Wed, 7 Dec 2011 16:29:03 +0100
+Subject: [PATCH 6/6] missed one more deprecated g_io_channel_read
+
+---
+ src/daemon/abrt-dbus.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/daemon/abrt-dbus.c b/src/daemon/abrt-dbus.c
+index 756076a..16c01d0 100644
+--- a/src/daemon/abrt-dbus.c
++++ b/src/daemon/abrt-dbus.c
+@@ -284,7 +284,7 @@ static gboolean handle_signal_cb(GIOChannel *gio, GIOCondition condition, gpoint
+ {
+     uint8_t signo;
+     gsize len = 0;
+-    g_io_channel_read(gio, (void*) &signo, 1, &len);
++    g_io_channel_read_chars(gio, (void*) &signo, 1, &len, NULL);
+     if (len == 1)
+     {
+         /* we did receive a signal */
+-- 
+1.7.7.3
+
diff --git a/abrt.spec b/abrt.spec
index c2c103e..6f689bc 100644
--- a/abrt.spec
+++ b/abrt.spec
@@ -24,7 +24,11 @@ Source: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz
 Source1: abrt1_to_abrt2
 Patch0: blacklist.patch
 Patch1: abrt_disable_gpgcheck.diff
-Patch2: 0002-disabled-reporting-to-kerneloops.org.patch
+Patch3: 0002-disabled-reporting-to-kerneloops.org.patch
+Patch4: 0003-abrtd-fix-potential-problem-with-exitcode-check-on-p.patch
+Patch5: 0004-abrtd-always-explain-why-we-delete-corrupted-dir.-Cl.patch
+Patch6: 0005-more-glib2.31-fixes.patch
+Patch7: 0006-missed-one-more-deprecated-g_io_channel_read.patch
 BuildRequires: dbus-devel
 BuildRequires: gtk2-devel
 BuildRequires: rpm-devel >= 4.6
@@ -186,7 +190,11 @@ Virtual package to make easy default installation on desktop environments.
 %patch0 -p1 -b .blacklist
 # general
 %patch1 -p1 -b .gpg
-%patch2 -p1 -b .disable_koops_org
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
 
 %build
 autoconf


More information about the scm-commits mailing list