FiloSottile / age

A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.
https://age-encryption.org
BSD 3-Clause "New" or "Revised" License
15.79k stars 477 forks source link

Output file is always created, even if an error happens #411

Closed notramo closed 2 years ago

notramo commented 2 years ago

When there is an error, e.g. pressing Ctrl+C in password prompt, or something other, the output file is created as an empty file.

FiloSottile commented 2 years ago

That's weird, we had fixed this in 97b6569a66c5fa08ab2b79620bea5501d994c3a7.

Can you follow the issue template and share the age version and the command line you used?

notramo commented 2 years ago

It's 1.0.0. I can't reproduce now, but it happened with this version. I don't know the exact parameters that can reproduce it. Maybe terminal I/O was messed up somehow? It was in password mode.

FiloSottile commented 2 years ago

If you used shell redirection, like age -p input > output.age, then the shell created the file and there's nothing age can do about it. If you used -o output and exited during the password prompt, then it's a bug, but I can't reproduce it. If you can, please post a transcript and I'll reopen the issue!