mirror of
https://github.com/reactos/syzkaller.git
synced 2025-02-20 03:21:26 +00:00
pkg/build: chmod output ssh key
ssh is very picky about ssh key permissions. Let's enforce the right persmissions without bothering user with this.
This commit is contained in:
parent
d19ed305ae
commit
7e7ceb21ba
@ -7,6 +7,7 @@ package build
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
@ -65,6 +66,11 @@ func Image(params *Params) (string, error) {
|
||||
if err != nil {
|
||||
return "", extractRootCause(err, params.TargetOS, params.KernelDir)
|
||||
}
|
||||
if key := filepath.Join(params.OutputDir, "key"); osutil.IsExist(key) {
|
||||
if err := os.Chmod(key, 0600); err != nil {
|
||||
return "", fmt.Errorf("failed to chmod 0600 %v: %v", key, err)
|
||||
}
|
||||
}
|
||||
sign := ""
|
||||
if signer, ok := builder.(signer); ok {
|
||||
sign, err = signer.sign(params)
|
||||
|
Loading…
x
Reference in New Issue
Block a user