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

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