mirror of
https://github.com/FiloSottile/age.git
synced 2026-03-11 08:55:41 +00:00
cmd/age-keygen: don't warn about world-readable output for public keys (#268)
Fixes #267
This commit is contained in:
parent
7309913372
commit
11659e8c97
1 changed files with 3 additions and 6 deletions
|
|
@ -102,12 +102,6 @@ func main() {
|
|||
out = f
|
||||
}
|
||||
|
||||
if fi, err := out.Stat(); err == nil {
|
||||
if fi.Mode().IsRegular() && fi.Mode().Perm()&0004 != 0 {
|
||||
fmt.Fprintf(os.Stderr, "Warning: writing secret key to a world-readable file.\n")
|
||||
}
|
||||
}
|
||||
|
||||
in := os.Stdin
|
||||
if inFile := flag.Arg(0); inFile != "" && inFile != "-" {
|
||||
f, err := os.Open(inFile)
|
||||
|
|
@ -121,6 +115,9 @@ func main() {
|
|||
if convertFlag {
|
||||
convert(in, out)
|
||||
} else {
|
||||
if fi, err := out.Stat(); err == nil && fi.Mode().IsRegular() && fi.Mode().Perm()&0004 != 0 {
|
||||
fmt.Fprintf(os.Stderr, "Warning: writing secret key to a world-readable file.\n")
|
||||
}
|
||||
generate(out)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue