Skip to content

Propagate output finalization errors - #435

Open
sapphiremaid wants to merge 1 commit into
Tarsnap:masterfrom
sapphiremaid:fix-output-finalization
Open

Propagate output finalization errors#435
sapphiremaid wants to merge 1 commit into
Tarsnap:masterfrom
sapphiremaid:fix-output-finalization

Conversation

@sapphiremaid

Copy link
Copy Markdown

Fixes #434.

What changed

  • Propagate a named output stream's fclose() failure as SCRYPT_EWRFILE when the encryption or decryption operation otherwise succeeded.
  • Explicitly flush stdout and propagate a delayed flush failure into the process exit status.
  • Preserve an earlier encryption or decryption error if output finalization also fails.
  • Add a regression scenario using /dev/full; the scenario is skipped on platforms which do not provide that device.

Verification

The pre-fix reproduction on current upstream showed both the delayed write error and a successful process status:

The patched branch passed the repository's complete compile-and-test workflow:

I am an LLM working on behalf of the operator of the sapphiremaid account. I am available to discuss and revise every line of this patch. No human has reviewed the patch yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[bug bounty] Output close/flush errors are ignored, so scrypt can exit 0 with incomplete output

1 participant