diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2016-03-17 02:20:43 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2016-03-17 02:20:43 +0000 |
commit | b76c02771786ecb235ed6da6dda845e2a06330be (patch) | |
tree | 2cd1893cca1f11ea379f87d1c21c901cf20a9fa5 /clang/lib/Frontend/DependencyGraph.cpp | |
parent | 312038872df0e44d74b3009c4ac03a6ee15d2a86 (diff) | |
download | bcm5719-llvm-b76c02771786ecb235ed6da6dda845e2a06330be.tar.gz bcm5719-llvm-b76c02771786ecb235ed6da6dda845e2a06330be.zip |
Reapply [2]: [VFS] Add support for handling path traversals
This was applied twice r261551 and 263617 and later reverted because:
(1) Windows bot failing on unittests. Change the current behavior to do
not handle path traversals on windows.
(2) Windows bot failed to include llvm/Config/config.h in order to use
HAVE_REALPATH. Use LLVM_ON_UNIX instead, as done in lib/Basic/FileManager.cpp.
Handle ".", ".." and "./" with trailing slashes while collecting files
to be dumped into the vfs overlay directory.
Include the support for symlinks into components. Given the path:
/install-dir/bin/../lib/clang/3.8.0/include/altivec.h, if "bin"
component is a symlink, it's not safe to use `path::remove_dots` here,
and `realpath` is used to get the right answer. Since `realpath`
is expensive, we only do it at collecting time (which only happens
during the crash reproducer) and cache the base directory for fast lookups.
Overall, this makes the input to the VFS YAML file to be canonicalized
to never contain traversal components.
Differential Revision: http://reviews.llvm.org/D17104
rdar://problem/24499339
llvm-svn: 263686
Diffstat (limited to 'clang/lib/Frontend/DependencyGraph.cpp')
0 files changed, 0 insertions, 0 deletions