Blame SOURCES/0088-a-a-save-package-data-turn-off-reading-data-from-roo.patch

a60cd7
From fdf93685d4f3fc36fe50d34a11e24662c4cb2d8c Mon Sep 17 00:00:00 2001
a60cd7
From: Jakub Filak <jfilak@redhat.com>
a60cd7
Date: Wed, 15 Apr 2015 12:12:59 +0200
a60cd7
Subject: [ABRT PATCH] a-a-save-package-data: turn off reading data from root
a60cd7
 directories
a60cd7
a60cd7
Making copies of files from arbitrary root directories is not secure.
a60cd7
a60cd7
Related: #1211835
a60cd7
a60cd7
Signed-off-by: Jakub Filak <jfilak@redhat.com>
a60cd7
---
a60cd7
 src/daemon/abrt-action-save-package-data.c | 8 ++------
a60cd7
 1 file changed, 2 insertions(+), 6 deletions(-)
a60cd7
a60cd7
diff --git a/src/daemon/abrt-action-save-package-data.c b/src/daemon/abrt-action-save-package-data.c
a60cd7
index 6dbcfc2..97d5f5e 100644
a60cd7
--- a/src/daemon/abrt-action-save-package-data.c
a60cd7
+++ b/src/daemon/abrt-action-save-package-data.c
a60cd7
@@ -223,7 +223,6 @@ static int SavePackageDescriptionToDebugDump(const char *dump_dir_name)
a60cd7
 
a60cd7
     char *cmdline = NULL;
a60cd7
     char *executable = NULL;
a60cd7
-    char *rootdir = NULL;
a60cd7
     char *package_short_name = NULL;
a60cd7
     struct pkg_envra *pkg_name = NULL;
a60cd7
     char *component = NULL;
a60cd7
@@ -233,8 +232,6 @@ static int SavePackageDescriptionToDebugDump(const char *dump_dir_name)
a60cd7
 
a60cd7
     cmdline = dd_load_text_ext(dd, FILENAME_CMDLINE, DD_FAIL_QUIETLY_ENOENT);
a60cd7
     executable = dd_load_text(dd, FILENAME_EXECUTABLE);
a60cd7
-    rootdir = dd_load_text_ext(dd, FILENAME_ROOTDIR,
a60cd7
-                               DD_FAIL_QUIETLY_ENOENT | DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE);
a60cd7
 
a60cd7
     /* Close dd while we query package database. It can take some time,
a60cd7
      * don't want to keep dd locked longer than necessary */
a60cd7
@@ -246,7 +243,7 @@ static int SavePackageDescriptionToDebugDump(const char *dump_dir_name)
a60cd7
         goto ret; /* return 1 (failure) */
a60cd7
     }
a60cd7
 
a60cd7
-    pkg_name = rpm_get_package_nvr(executable, rootdir);
a60cd7
+    pkg_name = rpm_get_package_nvr(executable, NULL);
a60cd7
     if (!pkg_name)
a60cd7
     {
a60cd7
         if (settings_bProcessUnpackaged)
a60cd7
@@ -329,7 +326,7 @@ static int SavePackageDescriptionToDebugDump(const char *dump_dir_name)
a60cd7
          */
a60cd7
     }
a60cd7
 
a60cd7
-    component = rpm_get_component(executable, rootdir);
a60cd7
+    component = rpm_get_component(executable, NULL);
a60cd7
 
a60cd7
     dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
a60cd7
     if (!dd)
a60cd7
@@ -355,7 +352,6 @@ static int SavePackageDescriptionToDebugDump(const char *dump_dir_name)
a60cd7
  ret:
a60cd7
     free(cmdline);
a60cd7
     free(executable);
a60cd7
-    free(rootdir);
a60cd7
     free(package_short_name);
a60cd7
     free_pkg_envra(pkg_name);
a60cd7
     free(component);
a60cd7
-- 
a60cd7
1.8.3.1
a60cd7