summaryrefslogtreecommitdiff
path: root/docker/utils
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2018-03-21 13:54:43 +0100
committerJoffrey F <f.joffrey@gmail.com>2018-03-21 14:20:41 +0100
commit7a28cad58ec7c279b91c75a3aa701bb89e0e75cd (patch)
treefb02a9ff8635e53cd2168ab56b283f36b9ee9a00 /docker/utils
parent284c3d90d6ab1c49410d5622ca8cd3f37dcbe296 (diff)
downloaddocker-py-7a28cad58ec7c279b91c75a3aa701bb89e0e75cd.tar.gz
Don't descend into symlinks when building context tar
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'docker/utils')
-rw-r--r--docker/utils/build.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/docker/utils/build.py b/docker/utils/build.py
index 1622ec3..894b299 100644
--- a/docker/utils/build.py
+++ b/docker/utils/build.py
@@ -93,7 +93,7 @@ def walk(root, patterns, default=True):
# Whether this file is implicitely included / excluded.
matched = default if hit is None else hit
sub = list(filter(lambda p: p[1], sub))
- if os.path.isdir(cur):
+ if os.path.isdir(cur) and not os.path.islink(cur):
# Entirely skip directories if there are no chance any subfile will
# be included.
if all(not p[0] for p in sub) and not matched: