From 2c5411b00cc376e6e4307ebbe47fed4bbfafddb2 Mon Sep 17 00:00:00 2001 From: Thibault Meyer <0xbaadf00d@users.noreply.github.com> Date: Wed, 17 Aug 2016 20:38:42 +0200 Subject: [PATCH] Fix #3361: Dumps are created world readable (#3473) * Set dump file permission to 0600 * Typo --- cmd/dump.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/dump.go b/cmd/dump.go index 62f45ed78..b2a5815f3 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -96,6 +96,10 @@ func runDump(ctx *cli.Context) error { log.Fatalf("Fail to save %s: %v", fileName, err) } + if err := os.Chmod(fileName, 0600); err != nil { + log.Printf("Can't change file access permissions mask to 0600: %v", err) + } + log.Printf("Removing tmp work dir: %s", TmpWorkDir) os.RemoveAll(TmpWorkDir) log.Printf("Finish dumping in file %s", fileName)