Skip to content

Update from php-rar#4

Open
macintoshplus wants to merge 82 commits intophp-win-ext:v4.xfrom
cataphract:master
Open

Update from php-rar#4
macintoshplus wants to merge 82 commits intophp-win-ext:v4.xfrom
cataphract:master

Conversation

@macintoshplus
Copy link
Copy Markdown

No description provided.

cataphract and others added 23 commits March 8, 2026 15:43
…esolution

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
unrar 7.0 converted all path/name variables from wchar arrays to
std::wstring. Update extractchunk.cpp to use the new API:
- ArcName, DestFileName, DllDestName are now std::wstring
- VolNameToFirstName and ConvertPath have new signatures

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The RARHeaderDataEx struct gained ArcNameEx and FileNameEx pointer fields
in unrar 7.0. In rarentry.c the struct was declared on the stack without
initialization, leaving these pointers with garbage values. RARReadHeaderEx
checks if these pointers are non-NULL before writing through them, so it
would follow the garbage pointer and cause a segfault (reproducible in
test 004.phpt).

Fix by zero-initializing the struct at declaration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ar 7.1

unrar 7.1 added largepage.cpp and motw.cpp. Add largepage.cpp to the
build (its LargePageAlloc class is declared without platform guards and
compiled cleanly on Linux with the Windows-only code guarded out).

Exclude motw.cpp because MarkOfTheWeb is only declared when PROPAGATE_MOTW
is set (Windows-only), so motw.cpp cannot compile on Linux.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
unrar 7.2.4 changed RARReadHeaderEx and ProcessFile to return
RarErrorToDll(ErrHandler.GetErrorCode()) on the success path instead of
ERAR_SUCCESS. This caused RARX_CRC errors set during header CRC
validation (which still allows the header to be read successfully) to
propagate as ERAR_BAD_DATA, breaking the entry listing loop for archives
with broken header checksums even when allow_broken is set.

Non-fatal error codes RARX_SUCCESS, RARX_WARNING, and RARX_CRC should
not cause RARReadHeaderEx or ProcessFile to return failure on the success
path; callers detect data integrity issues via BrokenHeader or the list
result separately.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
These files implement LargePageAlloc and MarkOfTheWeb classes
respectively, which were causing 13 unresolved external symbols
during the Windows DLL link step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cataphract and others added 6 commits March 11, 2026 01:38
Make it consistent with the rest of the extension, which assumes MBS
paths as being in UTF-8.
Add a musl/LLVM Docker build environment for compiling portable Linux
binaries that work on both musl and glibc systems, along with a minimal
PHP Docker image for testing. Add CI workflows to build and publish
these images to ghcr.io. Update test and build scripts to use the new
Docker-based environment, and remove SKIPIF guards from tests since the
extension is always present and doing otherwise would mask extension
loading failures.
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.

3 participants