From 7f76fa31168a2e7aff80c1d25cc3a420ef409b59 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Tue, 6 Mar 2012 09:25:00 +0000 Subject: Ensure relative symlink targets are correctly handled when copying Resolves: bz782589 --- sos/plugintools.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sos/plugintools.py b/sos/plugintools.py index 403e25cd..42f5f8d7 100644 --- a/sos/plugintools.py +++ b/sos/plugintools.py @@ -176,6 +176,10 @@ class PluginBase: except OSError: # self.soslog.debug("skipping symlink creation: already exists (%s)" % dstslname) return + if os.path.isabs(link): + self.doCopyFileOrDir(link) + else: + self.doCopyFileOrDir(os.path.join(os.path.dirname(srcpath), link)) self.copiedFiles.append({'srcpath':srcpath, 'dstpath':rpth, 'symlink':"yes", 'pointsto':link}) return -- cgit