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>
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>
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>
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>
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>
unrar 7.0 removed the NM path-size define from os.hpp, but the PHP
extension code in rar.c still uses it. Add NM back as a compatibility
define with the same value (2048).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The conflict resolution accidentally closed the while(true) password loop
prematurely. Fix the brace structure so our custom empty-password check
sits inside the loop before the SetEncryption/PswCheck code.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
isnt.cpp was added in unrar 6.1.5 without platform guards, causing
compilation failure on Linux due to Windows-only headers (comdef.h,
Wbemidl.h). Wrap entire implementation in #ifdef _WIN_ALL to match
the original pattern and rar.hpp include guard.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wire up PHP 8.3 Linux matrix jobs and Justfile targets. Fix three EXPECTF
patterns in tests/002, 003, 008: PHP 8.3 changed the type-error message
wording from "bool given" to "false given", so widen "boo%s" to "%s" to
match both old and new phrasing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wire up PHP 8.2 Linux matrix jobs and Justfile targets. Update Windows CI
to PHP 8.2. Fix the __toString() methods on RarArchive and RarEntry to
declare IS_STRING return type under PHP_VERSION_ID >= 80200 — PHP 8.2
enforces that __toString() has a declared string return type and emits
warnings (breaking tests) without it.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wire up PHP 8.1 Linux matrix jobs (debug + release-zts) via Docker image
SHA entries and Justfile targets. Update Windows CI job from PHP 8.0 to 8.1.
No C source changes required for 8.1 compatibility.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the old Azure Pipelines + Appveyor setup with GitHub Actions:
- Add .github/workflows/tests.yml with Linux (matrix) and Windows jobs
- Add .github/scripts/build-and-test.sh (shared build+test script)
- Add .github/scripts/update-docker-shas.sh (Docker image SHA lockfile updater)
- Add .github/docker-image-shas.yml (pinned OCI index digests for Linux jobs)
- Add Justfile for local test targets mirroring CI
- Add unrar_update.md documenting the unrar update process
- Remove azure-pipelines.yml, azure-template.yml, appveyor.yml, appveyor.bat,
test_funcs.sh
On Windows, RAR_SMP is defined and Unpack5MT is used when MaxUserThreads > 1
(i.e. on any multi-core machine). Unlike Unpack5, Unpack5MT does not set
FileExtracted = true on completion, leaving it false after SetDestSize() clears
it. In chunk extraction mode (suspendAfterInit = true), this caused
RARProcessFileChunk to return *finished = false even after writing all data,
triggering a second unnecessary call that wrote 0 bytes and fired the spurious
"Extraction reported as unfinished but no data read" warning.
Fix by skipping Unpack5MT when suspendAfterInit is true, falling through to
Unpack5 which correctly implements the suspend/resume protocol. The existing
comment in DoUnpack already noted that Unpack5MT must not be used in suspended
mode; the condition just wasn't enforced.
Remove the now-stale Appveyor skip from test 101.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>