[PATCH] D17104: [VFS] Drop path traversal assertion

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 18 13:36:34 PST 2016


bruno updated this revision to Diff 48397.
bruno added a comment.

Updated the patch, with the following changes:

  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 patch makes the input to the VFS YAML file to be canonicalized
  to never contain traversal components.


http://reviews.llvm.org/D17104

Files:
  lib/Basic/VirtualFileSystem.cpp
  lib/Frontend/ModuleDependencyCollector.cpp
  test/Modules/crash-vfs-path-symlink-component.m
  test/Modules/crash-vfs-path-traversal.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17104.48397.patch
Type: text/x-patch
Size: 14648 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160218/263f2138/attachment-0001.bin>


More information about the cfe-commits mailing list