diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2018-09-12 16:11:07 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2018-09-12 16:14:44 +0100 |
commit | 868966cd9dbb96ce3635d884e67e738b18658140 (patch) | |
tree | b83641252b670a28c7efb0ae5bb0de7139ae84e5 | |
parent | c065be9715dc845b6411a9a0b2d6171bbeb1c390 (diff) | |
download | sos-868966cd9dbb96ce3635d884e67e738b18658140.tar.gz |
[archive] canonicalise paths for link follow up
Ensure that the canonical path is used when processing link follow
up actions: the actual link path may contain one or more levels of
symbolic links, leading to broken links if the link target path is
assumed to be relative to the containing directory.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/archive.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sos/archive.py b/sos/archive.py index 7a7717de..483d66f4 100644 --- a/sos/archive.py +++ b/sos/archive.py @@ -421,7 +421,7 @@ class FileCacheArchive(Archive): (source, link_name, dest)) source_dir = os.path.dirname(link_name) - host_path_name = os.path.normpath(os.path.join(source_dir, source)) + host_path_name = os.path.realpath(os.path.join(source_dir, source)) dest_path_name = self.dest_path(host_path_name) if not os.path.exists(dest_path_name): |