Fix a mode of files/dir (report, log)

This commit is contained in:
Kota Kanbe
2016-09-14 17:47:12 +09:00
parent 3d68783b7f
commit fb70d1b2f0
4 changed files with 6 additions and 6 deletions

View File

@@ -65,7 +65,7 @@ func (w JSONWriter) Write(scanResults []models.ScanResult) (err error) {
return fmt.Errorf("Failed to Marshal to JSON: %s", err)
}
all := filepath.Join(path, "all.json")
if err := ioutil.WriteFile(all, jsonBytes, 0644); err != nil {
if err := ioutil.WriteFile(all, jsonBytes, 0600); err != nil {
return fmt.Errorf("Failed to write JSON. path: %s, err: %s", all, err)
}
@@ -81,7 +81,7 @@ func (w JSONWriter) Write(scanResults []models.ScanResult) (err error) {
if jsonBytes, err = json.Marshal(r); err != nil {
return fmt.Errorf("Failed to Marshal to JSON: %s", err)
}
if err := ioutil.WriteFile(jsonPath, jsonBytes, 0644); err != nil {
if err := ioutil.WriteFile(jsonPath, jsonBytes, 0600); err != nil {
return fmt.Errorf("Failed to write JSON. path: %s, err: %s", jsonPath, err)
}
}