aboutsummaryrefslogtreecommitdiff
path: root/tofu/tofu.go
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-03-06 15:11:30 -0500
committerAdnan Maolood <[email protected]>2021-03-06 15:11:30 -0500
commit5677440876e64ce9efc6d83f01a35e6a858f47a6 (patch)
treec69450cdbb23745e15c3892219cd5f077ccaf588 /tofu/tofu.go
parentcertificate.Store: Don't call os.MkdirAll (diff)
downloadgo-gemini-5677440876e64ce9efc6d83f01a35e6a858f47a6.tar.xz
go-gemini-5677440876e64ce9efc6d83f01a35e6a858f47a6.zip
tofu: Automatically create file in KnownHosts.Load
Diffstat (limited to 'tofu/tofu.go')
-rw-r--r--tofu/tofu.go2
1 files changed, 1 insertions, 1 deletions
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
}