aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2012-03-06 09:25:00 +0000
committerBryn M. Reeves <bmr@redhat.com>2012-03-19 17:45:46 +0000
commit7f76fa31168a2e7aff80c1d25cc3a420ef409b59 (patch)
tree88ec8ec9e789ac28e4337bfa1a3aa14994d39a86
parent2d7d06652ef35f4350f3ca6352bb95d6fad4415f (diff)
downloadsos-7f76fa31168a2e7aff80c1d25cc3a420ef409b59.tar.gz
Ensure relative symlink targets are correctly handled when copying
Resolves: bz782589
-rw-r--r--sos/plugintools.py4
1 files changed, 4 insertions, 0 deletions
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