Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 0600 for files created by Beats #3387

Merged
merged 3 commits into from
Jan 17, 2017

Conversation

andrewkroh
Copy link
Member

This change applies to registry, log, and output files. Previously files were created with 0644.

This change applies to registry, log, and output files. Previously files were created with 0644.
@@ -298,7 +298,7 @@ func (r *Registrar) writeRegistry() error {
logp.Debug("registrar", "Write registry file: %s", r.registryFile)

tempfile := r.registryFile + ".new"
f, err := os.Create(tempfile)
f, err := os.OpenFile(tempfile, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could put these flags into a constant as we reuse them in several places or have a function in libbeat to open files which automatically applies flags and correct access rights.

@ruflin ruflin merged commit 0af759a into elastic:master Jan 17, 2017
@andrewkroh andrewkroh deleted the feature/created-file-permissions branch March 31, 2017 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants