mirror of https://github.com/containers/podman.git
commit
3c74a44eb7
|
@ -34,7 +34,7 @@ func newLogFileEventer(options EventerOptions) (*EventLogFile, error) {
|
|||
}
|
||||
// We have to make sure the file is created otherwise reading events will hang.
|
||||
// https://github.com/containers/podman/issues/15688
|
||||
fd, err := os.OpenFile(options.LogFilePath, os.O_RDONLY|os.O_CREATE, 0700)
|
||||
fd, err := os.OpenFile(options.LogFilePath, os.O_RDONLY|os.O_CREATE, 0600)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create event log file: %w", err)
|
||||
}
|
||||
|
@ -68,6 +68,7 @@ func (e EventLogFile) writeString(s string) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer f.Close()
|
||||
return writeToFile(s, f)
|
||||
}
|
||||
|
||||
|
@ -168,7 +169,7 @@ func (e EventLogFile) Read(ctx context.Context, options ReadOptions) error {
|
|||
|
||||
event, err := newEventFromJSONString(line.Text)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("event type %s is not valid in %s", event.Type.String(), e.options.LogFilePath)
|
||||
err := fmt.Errorf("event type is not valid in %s", e.options.LogFilePath)
|
||||
options.EventChannel <- ReadResult{Error: err}
|
||||
continue
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue