You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func (s *blockStore) openWriteFile(fileNum uint32) (filer, error) {
// The current block file needs to be read-write so it is possible to
// append to it. Also, it shouldn't be part of the least recently used
// file.
filePath := blockFilePath(s.basePath, fileNum)
file, err := os.OpenFile(filePath, os.O_RDWR|os.O_CREATE, 0666) // HERE
if err != nil {
str := fmt.Sprintf("failed to open file %q: %v", filePath, err)
return nil, makeDbErr(database.ErrDriverSpecific, str, err)
}
return file, nil
}
Should be 0640 or 0660, but 0666 lets anyone r/w to the file called via openWriteFile() on the local system.
The text was updated successfully, but these errors were encountered:
blockauditech
changed the title
Overly permissive file permissions
Overly broad file permissions
May 2, 2018
database/ffldb/blockio.go
Should be 0640 or 0660, but 0666 lets anyone r/w to the file called via openWriteFile() on the local system.
The text was updated successfully, but these errors were encountered: