460 Commits

Author SHA1 Message Date
Gustavo Lopes
b4d66343e7 Do not build linux binaries on release 2026-03-09 10:59:06 +00:00
Gustavo Lopes
2ef087bd9e Version validation in CI 2026-03-09 10:34:59 +00:00
Gustavo Lopes
d9bc8cd4c5 Merge pull request #26 from remicollet/patch-1
Fix version
2026-03-09 09:59:38 +00:00
Remi Collet
60eaceb6ee Fix version 2026-03-09 07:21:40 +01:00
Gustavo Lopes
b6d9dc8eae Update README.md 2026-03-09 00:26:34 +00:00
Gustavo Lopes
d58737756c Fix release build on 32-bit windows 2026-03-09 00:19:32 +00:00
Gustavo Lopes
b79e6491b5 Prepare 4.3.0 release 2026-03-08 23:54:43 +00:00
Gustavo Lopes
1f1baf4fc1 Fix for 32-bit windows 2026-03-08 23:54:43 +00:00
Gustavo Lopes
4e914be013 .gitignore 2026-03-08 23:07:15 +00:00
Gustavo Lopes
05c8e5e675 Fix warning 2026-03-08 23:07:05 +00:00
Gustavo Lopes
b482f2f156 Add largepage.cpp and motw.cpp to Windows build config
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>
2026-03-08 21:51:37 +00:00
Gustavo Lopes
4115c69fe2 Fix wrong printf format 2026-03-08 21:48:55 +00:00
Gustavo Lopes
ea74acb27b Remove NM definition. Size of P1 in actually MAXPATHSIZE 2026-03-08 21:48:41 +00:00
Gustavo Lopes
1b6a2a5aa4 Fix windows build 2026-03-08 21:15:48 +00:00
Gustavo Lopes
e5b9669359 Add but don't apply .clang-format 2026-03-08 21:12:54 +00:00
Gustavo Lopes
89ac57cd59 Fix dll.cpp: don't propagate non-fatal ErrHandler errors as failures
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>
2026-03-08 16:25:08 +00:00
Gustavo Lopes
440d2a14c8 Merge unrar 7.2.4 2026-03-08 15:55:36 +00:00
Gustavo Lopes
a169ed937e Fix build: add largepage.cpp, exclude motw.cpp (Windows-only) for unrar 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>
2026-03-08 15:55:01 +00:00
Gustavo Lopes
10e3e3222a Merge unrar 7.1.5 2026-03-08 15:52:13 +00:00
Gustavo Lopes
055906e455 Fix rarentry.c: zero-initialize RARHeaderDataEx to prevent segfault
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>
2026-03-08 15:51:10 +00:00
Gustavo Lopes
2d3b968d23 Update extractchunk.cpp for unrar 7.0 std::wstring API changes
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>
2026-03-08 15:44:13 +00:00
Gustavo Lopes
371536d3a8 Fix arccmt.cpp: remove extra brace introduced during 6.2.9 conflict resolution
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 15:43:06 +00:00
Gustavo Lopes
3f536c9f9d Fix os.hpp: restore NM define removed in unrar 7.0
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>
2026-03-08 15:42:32 +00:00
Gustavo Lopes
ff2aa63dbf Merge unrar 7.0.9 2026-03-08 15:42:00 +00:00
Gustavo Lopes
0cace1db4b Fix extract.cpp: fix brace mismatch in password check block after 6.2.9 merge
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>
2026-03-08 15:37:38 +00:00
Gustavo Lopes
0c05fac324 Merge unrar 6.2.9 2026-03-08 15:36:33 +00:00
Gustavo Lopes
ae9a4623fe Fix isnt.cpp: wrap Windows-only code in #ifdef _WIN_ALL
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>
2026-03-08 15:32:39 +00:00
Gustavo Lopes
88773b47f1 Merge unrar 6.1.5 2026-03-08 15:31:20 +00:00
Gustavo Lopes
5e74ad9803 Update unrar_update.md 2026-03-08 15:21:45 +00:00
Gustavo Lopes
f6650b4abe Remove PHP 5 support 2026-03-08 15:11:27 +00:00
Gustavo Lopes
be202cc5b1 Add PHP 8.3 CI support; fix type-error wording in tests
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>
2026-03-08 15:11:16 +00:00
Gustavo Lopes
6a2ec1ccfc Add PHP 8.2 CI support; fix __toString arginfo
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>
2026-03-08 15:10:36 +00:00
Gustavo Lopes
eb1a919fb9 Document php upgrade procedure.
Both debug and release-zts variants pass 109/109 tests under PHP 8.1.
2026-03-08 15:09:46 +00:00
Gustavo Lopes
5e063a9626 Add PHP 8.1 CI support
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>
2026-03-02 01:14:35 +00:00
Gustavo Lopes
4a4e67ec33 Moderninze run-tests.php; use it on windows CI too 2026-03-02 01:14:35 +00:00
Gustavo Lopes
3dcba946ab Migrate CI from Azure Pipelines/Appveyor to GitHub Actions
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
2026-03-01 18:14:32 +00:00
Gustavo Lopes
77cc02a1db Fix RAR5 chunk extraction spurious warning on Windows with multi-core CPUs
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>
2026-03-01 17:33:13 +00:00
Gustavo Lopes
0131eef66c Use zend_long in lieu of long where appropriate 2026-03-01 17:33:13 +00:00
Gustavo Lopes
823315f6d6 Added unrar 7.2.4 2026-02-28 01:18:16 +00:00
Gustavo Lopes
40a7872954 Added unrar 7.2.3 2026-02-28 01:18:16 +00:00
Gustavo Lopes
9babd4f983 Added unrar 7.2.2 2026-02-28 01:18:15 +00:00
Gustavo Lopes
366007b41a Added unrar 7.2.1 2026-02-28 01:18:14 +00:00
Gustavo Lopes
320f84b6ae Added unrar 7.1.5 2026-02-28 01:18:14 +00:00
Gustavo Lopes
899eb2cedd Added unrar 7.1.4 2026-02-28 01:18:13 +00:00
Gustavo Lopes
d21e05b1f7 Added unrar 7.1.3 2026-02-28 01:18:12 +00:00
Gustavo Lopes
1c76380291 Added unrar 7.1.2 2026-02-28 01:18:12 +00:00
Gustavo Lopes
55a566364a Added unrar 7.1.1 2026-02-28 01:18:11 +00:00
Gustavo Lopes
5823bb16b5 Added unrar 7.0.9 2026-02-28 01:18:11 +00:00
Gustavo Lopes
9a5d712d99 Added unrar 7.0.8 2026-02-28 01:18:10 +00:00
Gustavo Lopes
95fe328cc2 Added unrar 7.0.7 2026-02-28 01:18:09 +00:00