aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-04-29 17:23:06 +0000
committerJordan Rose <jordan_rose@apple.com>2013-04-29 17:23:06 +0000
commit1d75a3b8efb1b4233b3f431604efcd60da8623e4 (patch)
treee0b640c5208a0dca8379f471c84526dfdebd2076 /tools
parent7e6b564d59df6c0594bc3a577f33536850290dec (diff)
[analyzer] scan-view: don't ever serve absolute paths.
At one point in time scan-view allowed absolute paths to reference files within the server root, but this doesn't seem to be used anymore, and caused problems if a server-root-relative path actually matched an absolute path to an existing file. This patch just treats paths as server-root-relative all the time. PR15843 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180715 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/scan-view/ScanView.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/tools/scan-view/ScanView.py b/tools/scan-view/ScanView.py
index 32570b9858..ee08baa8ba 100644
--- a/tools/scan-view/ScanView.py
+++ b/tools/scan-view/ScanView.py
@@ -686,16 +686,8 @@ File Bug</h3>
if components[-1] == '':
components[-1] = 'index.html'
- suffix = '/'.join(components)
-
- # The summary may reference source files on disk using rooted
- # paths. Make sure these resolve correctly for now.
- # FIXME: This isn't a very good idea... we should probably
- # mark rooted paths somehow.
- if os.path.exists(posixpath.join('/', suffix)):
- path = posixpath.join('/', suffix)
- else:
- path = posixpath.join(self.server.root, suffix)
+ relpath = '/'.join(components)
+ path = posixpath.join(self.server.root, relpath)
if self.server.options.debug > 1:
print >>sys.stderr, '%s: SERVER: sending path "%s"'%(sys.argv[0],
@@ -708,8 +700,8 @@ File Bug</h3>
def send_path(self, path):
# If the requested path is outside the root directory, do not open it
- rel = os.path.abspath(os.path.join(self.server.root, path))
- if not rel.startswith(os.path.abspath(self.server.root) ):
+ rel = os.path.abspath(path)
+ if not rel.startswith(os.path.abspath(self.server.root)):
return self.send_404()
ctype = self.guess_type(path)