8000 Cannot create dir from full Windows path · Issue #369 · zlib-ng/minizip-ng · GitHub
[go: up one dir, main page]

Skip to content

Cannot create dir from full Windows path #369

Closed

Description

@tamasszarka

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.

Activity

  1. added a commit that references this issue on Mar 8, 2019
    9c70a48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedIssue or bug has been fixed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0