Skip to content

fix(setup): reuse verified Java after Behat config reset - #9379

Merged
vitormattos merged 3 commits into
mainfrom
fix/java-signature-path-without-appconfig
Nov 7, 2026
Merged

vitormattos merged 3 commits into
mainfrom
fix/java-signature-path-without-appconfig

Conversation

@vitormattos

@vitormattos vitormattos commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Resolve the installed Java release directory (rather than its parent) when java_path has been cleared by the Behat per-scenario reset.
  • Keep the existing SHA-512 signature verification and the reset behavior unchanged.
  • Cover missing AppConfig for x86_64/aarch64 and Linux/Alpine, missing releases, verified installations, tampered binaries, and missing files.
  • Align existing integration fixtures with InstallService::JAVA_URL_PATH_NAME instead of the obsolete hard-coded JRE version.

Rationale

Each Behat scenario calls libresign:developer:reset --all, which deletes java_path. SetupInstallPathResolver::resolveJava() previously selected the .../java parent without this config, whereas the signed file hashes are relative to .../java/jdk-<version>-jre. A valid installed Java release could therefore fail integrity verification and trigger unnecessary re-download/extraction.

Validation

All 21 GitHub Actions workflows for head dcd41271c14abe377185ee4848bd15cdc1ba4e43 completed successfully, including:

  • Targeted regression covered by PHPUnit in SQLite, MySQL, MariaDB and PostgreSQL.
  • Behat in SQLite, MySQL, MariaDB and PostgreSQL.
  • Playwright, PHP lint, PHP-CS-Fixer, static analysis and CodeQL.
  • REUSE compliance, conventional commits and DCO.
  • All three commits cryptographically signed and verified.

An isolated synthetic reproduction demonstrated that the old resolver rejected a valid installed release after clearing java_path, while the corrected path verifies valid content and still rejects tampered or missing files.

Scope

No changes to libresign:developer:reset, scenario isolation, database configuration, or CI database versions.

Backports

Automated backports could not apply directly because stable releases use the older SignSetupService::getInstallPath() implementation. Adapted backports:

Merged into main on November 7, 2026.

Use the versioned JRE directory when java_path is absent so SHA-512 verification
checks the same files as a configured installation. Preserve integrity
verification and add regression coverage for missing config, tampering,
missing files, architectures, and distros.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos
vitormattos requested a review from a team as a code owner November 7, 2026 14:59
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Stub the AppData folder lookup to the same vfsStream release used by the
signed-hash fixture. Keep real signature verification and its negative cases.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos

Copy link
Copy Markdown
Member Author

/backport to stable35

@backportbot-libresign backportbot-libresign Bot added the backport-request Request to backport a change to supported stable branches label Nov 7, 2026
@vitormattos

Copy link
Copy Markdown
Member Author

/backport to stable34

@vitormattos

Copy link
Copy Markdown
Member Author

/backport to stable33

@vitormattos
vitormattos merged commit 842c68c into main Nov 7, 2026
68 checks passed
@vitormattos
vitormattos deleted the fix/java-signature-path-without-appconfig branch November 7, 2026 16:21
@backportbot-libresign

Copy link
Copy Markdown

The backport to stable33 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable33
git pull origin stable33

# Create the new backport branch
git checkout -b backport/9379/stable33

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 2a0708a4 6686a74e dcd41271

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/9379/stable33

Error: Failed to check for changes with origin/stable33: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot-libresign

Copy link
Copy Markdown

The backport to stable34 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable34
git pull origin stable34

# Create the new backport branch
git checkout -b backport/9379/stable34

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 2a0708a4 6686a74e dcd41271

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/9379/stable34

Error: Failed to check for changes with origin/stable34: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot-libresign

Copy link
Copy Markdown

The backport to stable35 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable35
git pull origin stable35

# Create the new backport branch
git checkout -b backport/9379/stable35

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 2a0708a4 6686a74e dcd41271

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/9379/stable35

Error: Failed to check for changes with origin/stable35: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@vitormattos vitormattos added this to the Next Major (36) milestone Nov 7, 2026 — with ChatGPT Codex Connector
msoares94 pushed a commit to hadrontechnology/libresign that referenced this pull request Nov 7, 2026
Backport of LibreSign#9379, adapted to the stable installation service.
Preserve signed hash validation when AppConfig no longer contains java_path.
Add regression tests for distro, architecture, valid files, and tampering.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
msoares94 pushed a commit to hadrontechnology/libresign that referenced this pull request Nov 7, 2026
Backport of LibreSign#9379, adapted to the stable installation service.
Preserve signed hash validation when AppConfig no longer contains java_path.
Add regression tests for distro, architecture, valid files, and tampering.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-request Request to backport a change to supported stable branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant