aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2019-03-22 11:47:50 +0100
committerBryn M. Reeves <bmr@redhat.com>2019-03-22 12:35:01 +0000
commitf394c251425f7e5b5b99b8f6fa5b598f06e3d0d7 (patch)
treeb83cadf72ec3d9c11bad9226c2cd14e059cb893c
parentca868edc04566b856b9f2042243c426c8c829428 (diff)
downloadsos-f394c251425f7e5b5b99b8f6fa5b598f06e3d0d7.tar.gz
[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 <pmoravec@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/__init__.py3
1 files changed, 3 insertions, 0 deletions
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: