matcha
matcha copied to clipboard
FEAT: Implement atomic file writes in SecureWriteFile
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.
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.
Closing due to inactivity. Reopen if still relevant.