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

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