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