You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to be a bug.
When extracting an archive, directory creation fails when a subdirectory is to be extracted, but its parent directory in the archive has not yet been created. On the below exawmple structue, this issue occurs when trying to extract file_x earlier than file_y.
Example - extracting the below archive into d:\temp:
/dir1/
/subdir1/
/subdir1/file_x
/file_y
/dir2/
What specifically happens is that as the mz_dir_make function in mz_os.c runs to create the directory dir1/subdir1 for file_x on the file system, it goes ahead and breaks down the full Windows path d:\temp\dir1\subdir1 to components to be able to create it level-by-level, and it breaks it up based on path-separators (obviously), attempting to create them in this order:
d:
d:\temp
d:\temp\dir1
d:\temp\dir1\subdir1
That's to logic at least - but the first iteration fails, as CreateDirectoryW in mz_os_win32.c yields ERROR_ACCESS_DENIED for a drive letter, preventing the loop from continuing with the iteration on the target path, and ends up returning MZ_INTERNAL_ERROR from mz_zip_reader_save_all.
This is specific to Windows and to archives where subdirs occur before files on the same level inside a directory.
The text was updated successfully, but these errors were encountered:
tamasszarka
added a commit
to tamasszarka/minizip
that referenced
this issue
Mar 7, 2019
This seems to be a bug.
When extracting an archive, directory creation fails when a subdirectory is to be extracted, but its parent directory in the archive has not yet been created. On the below exawmple structue, this issue occurs when trying to extract file_x earlier than file_y.
Example - extracting the below archive into d:\temp:
/dir1/
/subdir1/
/subdir1/file_x
/file_y
/dir2/
What specifically happens is that as the mz_dir_make function in mz_os.c runs to create the directory dir1/subdir1 for file_x on the file system, it goes ahead and breaks down the full Windows path d:\temp\dir1\subdir1 to components to be able to create it level-by-level, and it breaks it up based on path-separators (obviously), attempting to create them in this order:
d:
d:\temp
d:\temp\dir1
d:\temp\dir1\subdir1
That's to logic at least - but the first iteration fails, as CreateDirectoryW in mz_os_win32.c yields ERROR_ACCESS_DENIED for a drive letter, preventing the loop from continuing with the iteration on the target path, and ends up returning MZ_INTERNAL_ERROR from mz_zip_reader_save_all.
This is specific to Windows and to archives where subdirs occur before files on the same level inside a directory.
The text was updated successfully, but these errors were encountered: