mirror of
https://github.com/FiloSottile/age.git
synced 2026-04-16 01:26:57 +00:00
cmd/age: add a TODO about not dumping decrypted binary to the terminal
This commit is contained in:
@@ -131,13 +131,15 @@ func main() {
|
||||
}
|
||||
defer f.Close()
|
||||
out = f
|
||||
} else if terminal.IsTerminal(int(os.Stdout.Fd())) && !decryptFlag {
|
||||
} else if terminal.IsTerminal(int(os.Stdout.Fd())) {
|
||||
if armorFlag {
|
||||
// If the output will go to a TTY, and it will be armored, buffer it
|
||||
// up so it doesn't get in the way of typing the input.
|
||||
buf := &bytes.Buffer{}
|
||||
defer func() { io.Copy(os.Stdout, buf) }()
|
||||
out = buf
|
||||
} else if decryptFlag && name != "-" {
|
||||
// TODO: buffer the output and check it's printable.
|
||||
} else if name != "-" {
|
||||
// If the output wouldn't be armored, refuse to send binary to the
|
||||
// terminal unless explicitly requested with "-o -".
|
||||
|
||||
Reference in New Issue
Block a user