From c15e3931330379c44b138b01306f8b73d3cd9840 Mon Sep 17 00:00:00 2001 From: Jim MacArthur Date: Fri, 5 Oct 2018 13:40:57 +0100 Subject: _casbaseddirectory: Ingore '.' when resolving --- buildstream/storage/_casbaseddirectory.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/buildstream/storage/_casbaseddirectory.py b/buildstream/storage/_casbaseddirectory.py index 5f6e897f3..640c90d07 100644 --- a/buildstream/storage/_casbaseddirectory.py +++ b/buildstream/storage/_casbaseddirectory.py @@ -280,7 +280,9 @@ class CasBasedDirectory(Directory): directory = root components = symlink.target.split(CasBasedDirectory._pb2_path_sep) for c in components: - if c == "..": + if c == ".": + pass + elif c == "..": directory = directory.parent else: directory = directory.descend(c, create=True) @@ -321,7 +323,9 @@ class CasBasedDirectory(Directory): # We ran out of path elements and ended up in a directory return directory c = components.pop(0) - if c == "..": + if c == ".": + pass + elif c == "..": print(" resolving {}: up-dir".format(c)) # If directory.parent *is* None, this is an attempt to access # '..' from the root, which is valid under POSIX; it just -- cgit v1.2.1