mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
EPUB Output: Ensure directories have the correct permissions bits set when unzipping an epub with unzip on Unix
This commit is contained in:
parent
a05dfa8d90
commit
a43026fee1
@ -35,7 +35,7 @@ def initialize_container(path_to_container, opf_name='metadata.opf',
|
||||
'''.format(opf_name, extra_entries=rootfiles).encode('utf-8')
|
||||
zf = ZipFile(path_to_container, 'w')
|
||||
zf.writestr('mimetype', 'application/epub+zip', compression=ZIP_STORED)
|
||||
zf.writestr('META-INF/', '', 0700)
|
||||
zf.writestr('META-INF/', '', 0755)
|
||||
zf.writestr('META-INF/container.xml', CONTAINER)
|
||||
for path, _, data in extra_entries:
|
||||
zf.writestr(path, data)
|
||||
|
@ -1297,9 +1297,7 @@ class ZipFile:
|
||||
Add a directory recursively to the zip file with an optional prefix.
|
||||
'''
|
||||
if prefix:
|
||||
zi = ZipInfo(prefix+'/')
|
||||
zi.external_attr = 16
|
||||
self.writestr(zi, '')
|
||||
self.writestr(prefix+'/', '', 0755)
|
||||
cwd = os.path.abspath(os.getcwd())
|
||||
try:
|
||||
os.chdir(path)
|
||||
|
Loading…
x
Reference in New Issue
Block a user