Skip to content

Default to 0644 when IPA entries have no Unix permissions#13

Merged
nythepegasus merged 1 commit into
SideStore:masterfrom
mikey820:fix/windows-ipa-permissions
May 26, 2026
Merged

Default to 0644 when IPA entries have no Unix permissions#13
nythepegasus merged 1 commit into
SideStore:masterfrom
mikey820:fix/windows-ipa-permissions

Conversation

@mikey820
Copy link
Copy Markdown

Summary

IPAs created with ZIP tooling on Windows store NTFS file attributes in the ZIP external_fa field and leave the Unix mode bits (the high 16 bits) unset. When unzipArchiveAtURL:toDirectory:progress:error: extracts such an archive, (info.external_fa >> 16) & 0x01FF evaluates to 0, and that mode is then applied via setAttributes:. The extracted files end up with mode 0000, so the later reads performed while signing the app fail with a permission error — which surfaces to users as "You don't have permission."

This is a common report from people building IPAs on Windows.

Fix

When no Unix mode bits are present, fall back to 0644 before applying permissions, so the archive extracts with readable files. Archives that carry valid Unix permissions are unaffected.

Testing

Built SideStore against this change and installed an IPA that was previously failing with the permission error on a Windows-zipped build; it now extracts and installs cleanly. IPAs produced by Xcode (which carry proper Unix permissions) are unchanged.

Fixes SideStore/SideStore#447

IPAs zipped on Windows store NTFS attributes in the ZIP external file
attributes and leave the Unix mode bits (the high 16 bits of external_fa)
unset. unzipArchiveAtURL: then derived a permission of 0 from those entries
and applied it with setAttributes:, leaving the extracted files with mode
0000. Subsequent reads during signing failed, surfacing to the user as
"You don't have permission".

Fall back to 0644 when no Unix mode bits are present so these archives
extract with readable permissions.

Fixes SideStore/SideStore#447
@mikey820
Copy link
Copy Markdown
Author

Heads up for reviewers: both CI failures here are pre-existing and unrelated to this change.

  • Build fails on a missing openssl/err.h while compiling the bundled ldid dependency (Dependencies/ldid/ldid.cpp).
  • Test iOS (swiftpm) auto-fails during setup because the workflow uses the deprecated actions/upload-artifact@v2, which GitHub now rejects before any build runs.

The same failures occur on master, so they aren't introduced by this PR. This diff only adds a permissions fallback in NSFileManager+Zip.m and doesn't touch ldid, OpenSSL, or any workflow files.

@nythepegasus
Copy link
Copy Markdown
Member

CI builds aren’t strictly necessary here since we pull this as a dependency to be rebuilt within SideStore anyway, the CI was mostly an attempted formality, so no worries on failures here!

@nythepegasus nythepegasus merged commit a484932 into SideStore:master May 26, 2026
0 of 2 checks passed
nythepegasus pushed a commit to SideStore/SideStore that referenced this pull request May 26, 2026
Update AltSign to include Windows IPA permissions fix

Bumps the AltSign submodule to SideStore/AltSign#13, which makes
unzipArchiveAtURL: fall back to 0644 when a ZIP entry carries no Unix
mode bits (as produced by Windows zip tooling). Previously these
entries extracted with mode 0000 and failed during signing with a
"You don't have permission" error.

Fixes #447
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.

It keeps saying You don't have permission. To view or change permissions, select the item in the Finder and choose File > Get Info.

2 participants