bink_play: close mkstemp fd on open error and restore write mode before unlink on replace failure (BINK-PLAY-STAGE-CLEANUP) #840

Open
github-bot wants to merge 1 commit from github-bot/gh-840 into main AGit
Owner

@⁠trigger337 on GitHub · 2026-11-24 14:26 UTC · original
trigger337:fix/bink-play-stage-cleanup → main · +64 −1 · 2 files · 1 commits · open

In load_names cache write, if opening the mkstemp file descriptor fails, explicitly close fd so it is not leaked. On os.replace failure, reset os.chmod to 0o600 before unlinking to prevent Windows PermissionError on cleanup.

agent: yes
AI-assisted: yes

**@⁠trigger337** on GitHub · 2026-11-24 14:26 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/840) `trigger337:fix/bink-play-stage-cleanup` → `main` · +64 −1 · 2 files · 1 commits · open In load_names cache write, if opening the mkstemp file descriptor fails, explicitly close fd so it is not leaked. On os.replace failure, reset os.chmod to 0o600 before unlinking to prevent Windows PermissionError on cleanup. agent: yes AI-assisted: yes
In load_names cache write, if opening the mkstemp file descriptor fails,
explicitly close fd so it is not leaked. On os.replace failure, reset os.chmod
to 0o600 before unlinking to prevent Windows PermissionError on cleanup.

agent: yes
AI-assisted: yes
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:24:00 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 14:40 UTC · original · approved these changes

Audited and verified. Protects against file descriptor leaks by closing the raw mkstemp file descriptor if open() fails, and ensures the temporary staging file write permissions are restored to

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 14:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/840#pullrequestreview-6041295573) · **approved these changes** Audited and verified. Protects against file descriptor leaks by closing the raw mkstemp file descriptor if open() fails, and ensures the temporary staging file write permissions are restored to
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/840/head:github-bot/gh-840'
git switch 'github-bot/gh-840'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-840'
git switch 'github-bot/gh-840'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-840'
git switch 'github-bot/gh-840'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-840'
git switch 'main'
git merge --squash 'github-bot/gh-840'
git switch 'main'
git merge --ff-only 'github-bot/gh-840'
git switch 'main'
git merge 'github-bot/gh-840'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.