Skip to content

FEAT: Implement atomic file writes in SecureWriteFile #598

@andrinoff

Description

@andrinoff

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions