From 6582870a39689e1f00b13b3a17ef33615ee2a3a0 Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Fri, 30 Aug 2024 16:14:44 +0200 Subject: [PATCH] [plugins] Apply --skip-files also to destination of symlinks Resolves: #3767 Signed-off-by: Pavel Moravec --- sos/report/plugins/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sos/report/plugins/__init__.py b/sos/report/plugins/__init__.py index d1e8d6c64..f88f0c0d2 100644 --- a/sos/report/plugins/__init__.py +++ b/sos/report/plugins/__init__.py @@ -1344,6 +1344,11 @@ def _copy_symlink(self, srcpath): # Absolute path to the link target. If SYSROOT != '/' this path # is relative to the host root file system. absdest = os.path.normpath(dest) + if self._is_skipped_path(absdest): + self._log_debug(f"skipping excluded path '{absdest}' as symlink " + f"destination from {srcpath}") + return + # adjust the target used inside the report to always be relative if os.path.isabs(linkdest): # Canonicalize the link target path to avoid additional levels