unarchive: support 8 character permission strings (#81705)

pull/78707/head
Gods 6 months ago committed by GitHub
parent ce9d268ab8
commit 7dde4901d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- unarchive - add support for 8 character permission strings for zip archives (https://github.com/ansible/ansible/pull/81705).

@ -500,7 +500,8 @@ class ZipArchive(object):
continue
# Check first and seventh field in order to skip header/footer
if len(pcs[0]) != 7 and len(pcs[0]) != 10:
# 7 or 8 are FAT, 10 is normal unix perms
if len(pcs[0]) not in (7, 8, 10):
continue
if len(pcs[6]) != 15:
continue
@ -552,6 +553,12 @@ class ZipArchive(object):
else:
permstr = 'rw-rw-rw-'
file_umask = umask
elif len(permstr) == 7:
if permstr == 'rwxa---':
permstr = 'rwxrwxrwx'
else:
permstr = 'rw-rw-rw-'
file_umask = umask
elif 'bsd' in systemtype.lower():
file_umask = umask
else:

Loading…
Cancel
Save