Skip to content

Fix edit losing the typed secret, and recipients with a trailing newline - #19

Merged
ocfox merged 2 commits into
masterfrom
edit-write-and-recipient-whitespace
Aug 2, 2026
Merged

Fix edit losing the typed secret, and recipients with a trailing newline#19
ocfox merged 2 commits into
masterfrom
edit-write-and-recipient-whitespace

Conversation

@ocfox

@ocfox ocfox commented Aug 2, 2026

Copy link
Copy Markdown
Owner

No description provided.

ocfox added 2 commits August 2, 2026 19:33
edit checked nothing about the destination until after the editor had
closed, and removed the plaintext on the way out, so writing into a
directory that does not exist threw away what had just been typed. Fresh
repositories have no secretsDir, which makes the very first secret the one
most likely to be lost. Create the directory before the editor runs, and
replace the file by rename so a write that fails partway cannot take the
previous ciphertext with it.
`kix.hostPubkey = ./secrets/host.pub` hands the file's contents to the
parser as they are. agessh tolerates the trailing newline and age's own
parser does not, so an age host key failed where an SSH one worked, and
only in seal, after the identity had already been unlocked.
@ocfox
ocfox merged commit 6bd9581 into master Aug 2, 2026
1 check passed
@ocfox
ocfox deleted the edit-write-and-recipient-whitespace branch August 2, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant