From 911708b95ccc892f5ffa6fe440c812dde365aed6 Mon Sep 17 00:00:00 2001 From: Seednode Date: Tue, 13 Jun 2023 08:50:13 -0500 Subject: [PATCH] Open files to export as O_WRONLY instead of O_RDWR --- cmd/root.go | 2 +- cmd/web.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 9a58dd1..61160d8 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -11,7 +11,7 @@ import ( ) const ( - Version string = "0.51.4" + Version string = "0.51.5" ) var ( diff --git a/cmd/web.go b/cmd/web.go index 0c35fd1..caf429e 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -118,7 +118,7 @@ func (i *Index) IsEmpty() bool { } func (i *Index) Export(path string) error { - file, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600) + file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600) if err != nil { return err } @@ -338,7 +338,7 @@ func (s *ServeStats) GetMostServed() string { } func (s *ServeStats) Export(path string) error { - file, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600) + file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600) if err != nil { return err }