diff --git a/cmd/restic/restic.go b/cmd/restic/restic.go index 8968627..c183fff 100644 --- a/cmd/restic/restic.go +++ b/cmd/restic/restic.go @@ -64,7 +64,7 @@ func checkCurrentSnapshotFolder(currentSnapshotFolder string) { if _, err := os.Stat(currentSnapshotFolder); err != nil { if os.IsNotExist(err) { logging.Print("Creating..." + currentSnapshotFolder) - if err := os.Mkdir(currentSnapshotFolder, os.ModePerm); err != nil { + if err := os.Mkdir(currentSnapshotFolder, 0o700); err != nil { logging.Fatal(err) } } else { @@ -75,7 +75,7 @@ func checkCurrentSnapshotFolder(currentSnapshotFolder string) { if err := os.RemoveAll(currentSnapshotFolder); err != nil { logging.Fatal(err) } - if err := os.Mkdir(currentSnapshotFolder, os.ModePerm); err != nil { + if err := os.Mkdir(currentSnapshotFolder, 0o700); err != nil { logging.Fatal(err) } logging.Print("Emptied.. " + currentSnapshotFolder) diff --git a/internal/config/config.go b/internal/config/config.go index 6310e79..c31a067 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -197,7 +197,7 @@ func GetConfigDir() string { fi, err := os.Stat(dir) if os.IsNotExist(err) { log.Print(fmt.Sprintf("Creating %s\n", dir)) - err = os.MkdirAll(dir, os.ModePerm) + err = os.MkdirAll(dir, 0o755) if err != nil { log.Fatal(err) }