Blame SOURCES/0221-lib-prevent-from-creating-non-root-sub-dirs-in-dump-.patch

baab13
From 2acf4b7691165003cae6308f006cef329802f79e Mon Sep 17 00:00:00 2001
baab13
From: Matej Habrnal <mhabrnal@redhat.com>
baab13
Date: Tue, 5 Apr 2016 14:51:28 +0200
baab13
Subject: [PATCH] lib: prevent from creating non-root sub-dirs in dump dir
baab13
baab13
In the case an uid element doesn't exist in time of dump dir creating, we have
baab13
to create dump dir owned by root.
baab13
baab13
Related to rhbz#1264921
baab13
baab13
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
baab13
---
baab13
 src/lib/hooklib.c | 7 ++++++-
baab13
 1 file changed, 6 insertions(+), 1 deletion(-)
baab13
baab13
diff --git a/src/lib/hooklib.c b/src/lib/hooklib.c
baab13
index 160a011..ed1607d 100644
baab13
--- a/src/lib/hooklib.c
baab13
+++ b/src/lib/hooklib.c
baab13
@@ -415,7 +415,12 @@ char* problem_data_save(problem_data_t *pd)
baab13
     if (g_settings_privatereports)
baab13
         dd = create_dump_dir_from_problem_data_ext(pd, g_settings_dump_location, 0);
baab13
     else
baab13
-        dd = create_dump_dir_from_problem_data(pd, g_settings_dump_location);
baab13
+    {
baab13
+        if (problem_data_get_content_or_NULL(pd, FILENAME_UID) == NULL)
baab13
+            dd = create_dump_dir_from_problem_data_ext(pd, g_settings_dump_location, 0);
baab13
+        else
baab13
+            dd = create_dump_dir_from_problem_data(pd, g_settings_dump_location);
baab13
+    }
baab13
 
baab13
     char *problem_id = NULL;
baab13
     if (dd)
baab13
-- 
baab13
1.8.3.1
baab13