Fix permission issue catched by GAS Scanner

This commit is contained in:
wangyan 2017-05-05 00:20:35 -07:00
parent a4a5ff6c60
commit 045b5a1c63

View File

@ -38,7 +38,7 @@ func NewLogger(jobID int64) (*log.Logger, error) {
log.Errorf("Failed to create directory for log file %s, the error: %v", logFile, err) log.Errorf("Failed to create directory for log file %s, the error: %v", logFile, err)
} }
} }
f, err := os.OpenFile(logFile, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0660) f, err := os.OpenFile(logFile, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0600)
if err != nil { if err != nil {
log.Errorf("Failed to open log file %s, the log of job %d will be printed to standard output, the error: %v", logFile, jobID, err) log.Errorf("Failed to open log file %s, the log of job %d will be printed to standard output, the error: %v", logFile, jobID, err)
f = os.Stdout f = os.Stdout