Browse Source

fix temporary history file permissions

Michael Yang 1 year ago
parent
commit
f95d2f25f3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      readline/history.go

+ 1 - 1
readline/history.go

@@ -132,7 +132,7 @@ func (h *History) Save() error {
 
 	tmpFile := h.Filename + ".tmp"
 
-	f, err := os.OpenFile(tmpFile, os.O_CREATE|os.O_WRONLY|os.O_TRUNC|os.O_APPEND, 0o666)
+	f, err := os.OpenFile(tmpFile, os.O_CREATE|os.O_WRONLY|os.O_TRUNC|os.O_APPEND, 0o600)
 	if err != nil {
 		return err
 	}