From 90b1e98d61d2c470cc66afc814a2f8d6833f55d2 Mon Sep 17 00:00:00 2001 From: adnano Date: Sat, 6 Mar 2021 15:11:30 -0500 Subject: [PATCH] tofu: Automatically create file in KnownHosts.Load --- tofu/tofu.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tofu/tofu.go b/tofu/tofu.go index 372a633..a2f2a9a 100644 --- a/tofu/tofu.go +++ b/tofu/tofu.go @@ -83,7 +83,7 @@ func (k *KnownHosts) WriteTo(w io.Writer) (int64, error) { // Load loads the known hosts entries from the provided path. func (k *KnownHosts) Load(path string) error { - f, err := os.Open(path) + f, err := os.OpenFile(path, os.O_CREATE|os.O_RDONLY, 0644) if err != nil { return err }