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

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