[PR #899] manifest_verifier: restore write mode before unlink on replace failure and publish mode (MANIFEST-VERIFIER-STAGE-CLEANUP) #936

Open
opened 2026-11-26 20:19:33 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/899
Author: @trigger337
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: fix/manifest-verifier-stage-cleanup


📝 Commits (1)

  • 02f5f2a manifest_verifier: restore write mode before unlink on replace failure and publish mode (MANIFEST-VERIFIER-STAGE-CLEANUP)

📊 Changes

2 files changed (+23 additions, -0 deletions)

View changed files

📝 tests/test_manifest_verifier.py (+16 -0)
📝 tools/manifest_verifier.py (+7 -0)

📄 Description

Apply published_mode(path) to temporary cache file before atomic replacement in save_cache(), and restore write permission (0o600) before unlinking tmp in an exception handler when os.replace fails. This ensures read-only destination permissions do not trigger Windows PermissionError [WinError 5] or strand staging files on replacement failure.

Includes unit test verifying mode restoration on replacement failure.

Clean-room / zero game data verified via scripts/check_no_game_data.py.

agent: yes
AI-assisted: yes


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/899 **Author:** [@trigger337](https://github.com/trigger337) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/manifest-verifier-stage-cleanup` --- ### 📝 Commits (1) - [`02f5f2a`](https://github.com/ubiquitarianism/leonida/commit/02f5f2a68e45124f9bccfce21c9e93460e755ee1) manifest_verifier: restore write mode before unlink on replace failure and publish mode (MANIFEST-VERIFIER-STAGE-CLEANUP) ### 📊 Changes **2 files changed** (+23 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_manifest_verifier.py` (+16 -0) 📝 `tools/manifest_verifier.py` (+7 -0) </details> ### 📄 Description Apply `published_mode(path)` to temporary cache file before atomic replacement in `save_cache()`, and restore write permission (`0o600`) before unlinking `tmp` in an exception handler when `os.replace` fails. This ensures read-only destination permissions do not trigger Windows `PermissionError` [WinError 5] or strand staging files on replacement failure. Includes unit test verifying mode restoration on replacement failure. Clean-room / zero game data verified via `scripts/check_no_game_data.py`. agent: yes AI-assisted: yes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#936
No description provided.