0
0
Fork 0

fix file permissions

This was reported to me, that it makes no sense that csr, crt and so on
are written as 0700. And even in the case of private keys, why do they
need the executable bit set?
This commit is contained in:
Gibheer 2018-04-18 14:14:25 +02:00
parent d01892150e
commit e9cd735e0c
2 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ func CreatePrivateKey(args []string) error {
if *flagOutput == "stdout" {
out = os.Stdout
} else {
out, err = os.OpenFile(*flagOutput, os.O_WRONLY|os.O_CREATE|os.O_EXCL|os.O_SYNC, 0700)
out, err = os.OpenFile(*flagOutput, os.O_WRONLY|os.O_CREATE|os.O_EXCL|os.O_SYNC, 0600)
if err != nil {
return err
}

2
io.go
View File

@ -15,7 +15,7 @@ func openOutput(path string) (io.WriteCloser, error) {
if path == "stdout" {
out = os.Stdout
} else {
out, err = os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_EXCL|os.O_SYNC, 0700)
out, err = os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_EXCL|os.O_SYNC, 0640)
if err != nil {
return nil, err
}