diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-05-30 11:03:21 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-05-30 11:04:21 +0200 |
| commit | 6f3e1c7c67bc16c53b8c778984c068c342ec5274 (patch) | |
| tree | 7825ad39453e628409b63358fd8fc22c00b77ae9 /pkg/build/netbsd.go | |
| parent | f7fbb18cba5a83d16ab7d977849e3b6003cf981d (diff) | |
pkg/build: chmod key file before running qemu
In case the original key has wrong permissions.
Ssh is very picky about key permissions.
Diffstat (limited to 'pkg/build/netbsd.go')
| -rw-r--r-- | pkg/build/netbsd.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/build/netbsd.go b/pkg/build/netbsd.go index 2a4d15440..ecf21ee77 100644 --- a/pkg/build/netbsd.go +++ b/pkg/build/netbsd.go @@ -6,6 +6,7 @@ package build import ( "encoding/json" "fmt" + "os" "path/filepath" "runtime" "strconv" @@ -76,6 +77,10 @@ func (ctx netbsd) build(params *Params) error { return fmt.Errorf("failed to copy %v -> %v: %v", fullSrc, fullDst, err) } } + keyFile := filepath.Join(params.OutputDir, "key") + if err := os.Chmod(keyFile, 0600); err != nil { + return fmt.Errorf("failed to chmod 0600 %v: %v", keyFile, err) + } return ctx.copyKernelToDisk(params.TargetArch, params.VMType, params.OutputDir, filepath.Join(compileDir, "netbsd")) } |
