Skip to content

Add the execute permission to directories that are marked as regular files - #448

Merged
weichsel merged 1 commit into
mainfrom
fix/inferred-directory-permissions
Nov 21, 2026
Merged

weichsel merged 1 commit into
mainfrom
fix/inferred-directory-permissions

Conversation

@weichsel

Copy link
Copy Markdown
Owner

Since 6f4c567, an entry like dir/ that is stored as S_IFREG | 0644 is extracted as a directory, but it keeps the file permissions 0644. Without the execute permission, the directory can't be entered, and extraction fails with "Permission denied" at dir/file.txt.

  • For directories that are stored as regular files, the execute permission is added wherever reading is permitted (0644 → 0755, 0600 → 0700). Entries that store the directory type or no file type keep their permissions.
  • Adds tests for the permission mapping and for extracting an archive with such entries.

…files

Some writers store directory entries with a regular file mode, e.g.
S_IFREG | 0644. Their type is derived from the trailing path delimiter,
but the stored file permissions lack the execute permission. Extracted
directories could not be entered, so extraction failed with "Permission
denied" at the first entry within them.

The execute permission is now added wherever reading is permitted. Entries
that store the directory type or no file type keep their permissions.
@weichsel weichsel self-assigned this Nov 21, 2026
@weichsel
weichsel merged commit 95bcf1f into main Nov 21, 2026
13 checks passed
@weichsel
weichsel deleted the fix/inferred-directory-permissions branch November 21, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant