From f394c251425f7e5b5b99b8f6fa5b598f06e3d0d7 Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Fri, 22 Mar 2019 11:47:50 +0100 Subject: [plugins] dont collect tail of fobidden file When a file is over sizelimit and we should collect just tail of it, check if the file isnt in forbidden paths first. Relevant to: #1596 Signed-off-by: Pavel Moravec Signed-off-by: Bryn M. Reeves --- sos/plugins/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py index 85ca3373..767e253d 100644 --- a/sos/plugins/__init__.py +++ b/sos/plugins/__init__.py @@ -647,6 +647,9 @@ class Plugin(object): _file = None for _file in files: + if self._is_forbidden_path(_file): + self._log_debug("skipping forbidden path '%s'" % _file) + continue try: current_size += os.stat(_file)[stat.ST_SIZE] except OSError: -- cgit