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

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