doczkal / rpms / abrt

Forked from rpms/abrt 4 years ago
Clone

Blame SOURCES/0062-applet-chown-each-notified-problem-before-reporting-.patch

44797e
From 19a0816a032b7fdc5243a358ee77376d988b2dfd Mon Sep 17 00:00:00 2001
44797e
From: Jakub Filak <jfilak@redhat.com>
44797e
Date: Fri, 27 Jun 2014 14:46:39 +0200
44797e
Subject: [ABRT PATCH 62/66] applet: chown each notified problem before
44797e
 reporting it
44797e
44797e
Not chowing all directories leads to stealing of koops problems and dump
44797e
dir stealing is obsolete because:
44797e
  - stolen directories are omitted in local duplicates search
44797e
  - root cannot seen those directories
44797e
44797e
Kernel oops problems are not problems of another user, they are rather
44797e
system problems. Koops problems are readable by all users but are not
44797e
writable. Fortunately koops directories can be chowned by all users
44797e
without providing any credentials.
44797e
44797e
Resolves #1084027
44797e
44797e
Chowing problem directories runs in abrt-dbus which shows an
44797e
authorization dialogue.
44797e
44797e
Signed-off-by: Jakub Filak <jfilak@redhat.com>
44797e
---
44797e
 src/applet/applet.c | 19 ++++++++++---------
44797e
 1 file changed, 10 insertions(+), 9 deletions(-)
44797e
44797e
diff --git a/src/applet/applet.c b/src/applet/applet.c
44797e
index 6ce400f..b1ce400 100644
44797e
--- a/src/applet/applet.c
44797e
+++ b/src/applet/applet.c
44797e
@@ -1164,17 +1164,18 @@ static void export_event_configuration(const char *event_name)
44797e
 
44797e
 static void run_event_async(problem_info_t *pi, const char *event_name, int flags)
44797e
 {
44797e
-    if (pi->foreign)
44797e
+    /* chown the directory in any case, because kernel oopses are not foreign */
44797e
+    /* but their dump directories are not writable without chowning them or */
44797e
+    /* stealing them. The stealing is deprecated as it breaks the local */
44797e
+    /* duplicate search and root cannot see them */
44797e
+    const int res = chown_dir_over_dbus(problem_info_get_dir(pi));
44797e
+    if (pi->foreign && res != 0)
44797e
     {
44797e
-        int res = chown_dir_over_dbus(problem_info_get_dir(pi));
44797e
-        if (res != 0)
44797e
-        {
44797e
-            error_msg(_("Can't take ownership of '%s'"), problem_info_get_dir(pi));
44797e
-            problem_info_free(pi);
44797e
-            return;
44797e
-        }
44797e
-        pi->foreign = false;
44797e
+        error_msg(_("Can't take ownership of '%s'"), problem_info_get_dir(pi));
44797e
+        problem_info_free(pi);
44797e
+        return;
44797e
     }
44797e
+    pi->foreign = false;
44797e
 
44797e
     struct dump_dir *dd = open_directory_for_writing(problem_info_get_dir(pi), /* don't ask */ NULL);
44797e
     if (!dd)
44797e
-- 
44797e
1.8.3.1
44797e