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
17.05k stars 500 forks source link

age: add --perm flag to set permissions on output file #385

Closed twpayne closed 2 years ago

twpayne commented 2 years ago

age currently writes files with permissions 666&^umask, which typically result in permissions 664 or 644, i.e. world- and group-readable.

If the file should not be world- or group-readable then an extra chmod command is required, but there is a short window between age writing the file and updating the permissions.

This commit adds a --perm flag that allows the permissions to be set on the output file at creation.

FiloSottile commented 2 years ago

Thank you, but I don't think this feature belongs in age. One can change the umask to change the permissions of created files, or a different UNIX tool can be used to redirect stdin to a file created with the permissions you like.

twpayne commented 2 years ago

Ack, thanks for the fast response :)