diff options
author | Joffrey F <joffrey@docker.com> | 2018-01-29 18:13:46 -0800 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2018-01-29 18:27:12 -0800 |
commit | 4e34300379a9d85d99192e890cef2f1f656c6761 (patch) | |
tree | 7685f84cec9eb078bcfe442ead472f2697d4c0c2 /docker/utils/utils.py | |
parent | 4ff296247b4ed9c4afbb0b5293bd4deecb4fe708 (diff) | |
download | docker-py-1841-tar-broken-symlinks.tar.gz |
Do not break when archiving broken symlinks1841-tar-broken-symlinks
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'docker/utils/utils.py')
-rw-r--r-- | docker/utils/utils.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/docker/utils/utils.py b/docker/utils/utils.py index 2de995c..c4db175 100644 --- a/docker/utils/utils.py +++ b/docker/utils/utils.py @@ -98,7 +98,8 @@ def create_archive(root, files=None, fileobj=None, gzip=False): files = build_file_list(root) for path in files: full_path = os.path.join(root, path) - if not os.access(full_path, os.R_OK): + + if os.lstat(full_path).st_mode & os.R_OK == 0: raise IOError( 'Can not access file in context: {}'.format(full_path) ) |