Skip to content

Commit

Permalink
Fix permissions of generated Filebeat filesets (elastic#7140)
Browse files Browse the repository at this point in the history
* fix generated files' permission

Closes elastic#6856

(cherry picked from commit 298fd63)
  • Loading branch information
kvch authored and ph committed Jun 18, 2018
1 parent ec0ade2 commit 8e1fe1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG-developer.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,11 @@ The list below covers the major changes between 6.3.0 and master only.

==== Breaking changes

- The beat.Pipeline is now passed to cfgfile.RunnerFactory. Beats using libbeat for module reloading or autodiscovery need to be adapted. {pull}7018[7017]
- Moving of TLS helper functions and structs from `output/tls` to `tlscommon`. {pull}7054[7054]

==== Bugfixes

- Fix permissions of generated Filebeat filesets. {pull}7140[7140]

==== Added
5 changes: 3 additions & 2 deletions filebeat/scripts/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func AppendTemplate(template, dest string, replace map[string]string) error {
return err
}

f, err := os.OpenFile(dest, os.O_WRONLY|os.O_APPEND, os.ModePerm)
f, err := os.OpenFile(dest, os.O_WRONLY|os.O_APPEND, 0644)
if err == nil {
_, err = f.Write(c)
}
Expand All @@ -66,10 +66,11 @@ func copyTemplate(template, dest string, replace map[string]string) error {
return err
}

err = ioutil.WriteFile(dest, c, os.ModePerm)
err = ioutil.WriteFile(dest, c, 0644)
if err != nil {
return fmt.Errorf("cannot copy template: %v", err)
}

return nil
}

Expand Down

0 comments on commit 8e1fe1f

Please sign in to comment.