age -o follows a symlink and writes a pipe or device directly (closes #59)
check / check (push) Failing after 2s

age encrypt -o and age decrypt -o always wrote a new file beside the
named path and renamed it over that path, which replaced a symlink, a
named pipe or a device such as /dev/null with a regular file and made
-o /dev/stdout fail. The path is now looked at without following a
final symlink: a missing path or a regular file is replaced by rename
as before, a symlink gets the same treatment for what it points at,
and anything else is written to directly, without catching signals.
A symlink that points at nothing is refused. The README says so, and
that a replaced file has mode 0600.

Model: opus-5-5
This commit is contained in:
2026-10-04 13:07:15 +00:00
parent dad29597bd
commit 983f554ac0
4 changed files with 148 additions and 14 deletions
+2 -1
View File
@@ -85,7 +85,8 @@ func init() {
// signals to clean up first: "ssh to" and "ssh install" while they
// have ssh or sftp running, so the child ends and their own cleanup
// still runs, and "age encrypt -o" and "age decrypt -o" while they
// write, so the unfinished file is removed.
// write a new file to rename over the named one, so the unfinished file
// is removed.
func Main() int {
err := Root().Execute()
if err == nil {