matcha icon indicating copy to clipboard operation
matcha copied to clipboard

FEAT: Implement atomic file writes in SecureWriteFile

Open andrinoff opened this issue 7 months ago • 2 comments

Is your feature request related to a problem?

SecureWriteFile in config/encryption.go writes directly to the target path. If the process crashes during the write, the file could be left in a corrupted or truncated state.

Describe the solution you'd like

Use an "atomic" write pattern: write to a temporary file first, then use os.Rename to move it to the final destination.

Describe alternatives you've considered

N/A

Additional context

This should be applied to SecureWriteFile and potentially regular os.WriteFile calls for important data.

andrinoff avatar Apr 16 '26 13:04 andrinoff

This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.

floatpanebot avatar May 17 '26 05:05 floatpanebot

Closing due to inactivity. Reopen if still relevant.

floatpanebot avatar May 31 '26 06:05 floatpanebot