Blame SOURCES/0065-plugin-enforce-forbidden-paths-when-sysroot-is-set.patch

0cd6dc
From 05939f9b27de1b057573495d737f88eef4797011 Mon Sep 17 00:00:00 2001
0cd6dc
From: "Bryn M. Reeves" <bmr@redhat.com>
0cd6dc
Date: Sun, 25 Jan 2015 23:27:51 +0000
0cd6dc
Subject: [PATCH 65/93] [plugin] enforce forbidden paths when --sysroot is set
0cd6dc
0cd6dc
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
0cd6dc
---
0cd6dc
 sos/plugins/__init__.py | 10 +++++++---
0cd6dc
 1 file changed, 7 insertions(+), 3 deletions(-)
0cd6dc
0cd6dc
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
0cd6dc
index 5df40ff..394973d 100644
0cd6dc
--- a/sos/plugins/__init__.py
0cd6dc
+++ b/sos/plugins/__init__.py
0cd6dc
@@ -311,6 +311,8 @@ class Plugin(object):
0cd6dc
         return None
0cd6dc
 
0cd6dc
     def _is_forbidden_path(self, path):
0cd6dc
+        if self.use_sysroot():
0cd6dc
+            path = self.join_sysroot(path)
0cd6dc
         return _path_in_path_list(path, self.forbidden_paths)
0cd6dc
 
0cd6dc
     def _copy_node(self, path, st):
0cd6dc
@@ -373,13 +375,15 @@ class Plugin(object):
0cd6dc
             'symlink': "no"
0cd6dc
         })
0cd6dc
 
0cd6dc
-    def add_forbidden_path(self, forbiddenPath):
0cd6dc
+    def add_forbidden_path(self, forbidden):
0cd6dc
         """Specify a path to not copy, even if it's part of a copy_specs[]
0cd6dc
         entry.
0cd6dc
         """
0cd6dc
+        if self.use_sysroot():
0cd6dc
+            forbidden = self.join_sysroot(forbidden)
0cd6dc
         # Glob case handling is such that a valid non-glob is a reduced glob
0cd6dc
-        for filespec in glob.glob(forbiddenPath):
0cd6dc
-            self.forbidden_paths.append(filespec)
0cd6dc
+        for path in glob.glob(forbidden):
0cd6dc
+            self.forbidden_paths.append(path)
0cd6dc
 
0cd6dc
     def get_all_options(self):
0cd6dc
         """return a list of all options selected"""
0cd6dc
-- 
0cd6dc
1.9.3
0cd6dc