diff options
author | Thibault Meyer <0xbaadf00d@users.noreply.github.com> | 2016-08-17 20:38:42 +0200 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2016-08-17 11:38:42 -0700 |
commit | 2c5411b00cc376e6e4307ebbe47fed4bbfafddb2 (patch) | |
tree | 7834039fb09d4251a4a1ceb02775ecd62a464ddb /cmd | |
parent | a00c932bbc5a76ba9b0457d7d20cd1d5fc185b3d (diff) | |
download | gitea-2c5411b00cc376e6e4307ebbe47fed4bbfafddb2.tar.gz gitea-2c5411b00cc376e6e4307ebbe47fed4bbfafddb2.zip |
Fix #3361: Dumps are created world readable (#3473)
* Set dump file permission to 0600
* Typo
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/dump.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/dump.go b/cmd/dump.go index 62f45ed785..b2a5815f32 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) |