Browse Source

Let's be more strict

Piotr Czajkowski 3 years ago
parent
commit
1720eeb67c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      storage.go

+ 2 - 2
storage.go

@@ -17,7 +17,7 @@ const (
 var links sync.Map
 
 func readLinks(path string) {
-	file, err := os.OpenFile(path, os.O_CREATE|os.O_RDONLY, 0644)
+	file, err := os.OpenFile(path, os.O_CREATE|os.O_RDONLY, 0600)
 	if err != nil {
 		log.Fatalf("Failed to open %s!\n", path)
 
@@ -81,7 +81,7 @@ func getLink(linkID string) string {
 }
 
 func saveLink(path string, toSave <-chan string) {
-	file, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
+	file, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600)
 	if err != nil {
 		log.Fatal(err)
 	}