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

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