posix: Mkdir() and OpenFile() should honor umask. (#1972)

Adds two unit tests for validation as well.

Fixes #1965
This commit is contained in:
Harshavardhana
2016-06-23 20:19:27 -07:00
committed by Anand Babu (AB) Periasamy
parent 41c089a7e0
commit ff9fc22c72
5 changed files with 215 additions and 8 deletions
+2 -1
View File
@@ -39,7 +39,8 @@ func enableFileLogger() {
return
}
file, err := os.OpenFile(flogger.Filename, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600)
// Creates the named file with mode 0666, honors system umask.
file, err := os.OpenFile(flogger.Filename, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0666)
fatalIf(err, "Unable to open log file.")
// Add a local file hook.