logstash-plugins / logstash-output-file

Apache License 2.0
23 stars 53 forks source link

Allow setting dir and file permmissions, closes #18 #27

Closed bobrik closed 8 years ago

bobrik commented 8 years ago

Disclaimer: I don't know ruby.

untergeek commented 8 years ago

I'm getting some conflicts with the test:

1) LogStash::Outputs::File receiving events output string format when using file and dir modes dirs and files are created with correct permissions
     Failure/Error: expect(File.stat(first_good_dir).mode.to_s(8)).to eq('100750')

       expected: "100750"
            got: "40750"

This may be because I'm testing on OS X, but that is an acceptable runtime environment.

untergeek commented 8 years ago

It's doing the same thing on my Ubuntu 14.04 box:

Failures:

  1) LogStash::Outputs::File receiving events output string format when using file and dir modes dirs and files are created with correct permissions
     Failure/Error: expect(File.stat(first_good_dir).mode.to_s(8)).to eq('100750')

       expected: "100750"
            got: "40750"

       (compared using ==)
bobrik commented 8 years ago

I'm on OS X as well:

$ stat -f %p README.md
100644

I'm thinking about dropping anything above the third octet in the test. What do you think?

untergeek commented 8 years ago

I think the umask should be limited to the last octet. If doing so, would you please change or add a few other tests to use atypical masks? 750 and 644 are common enough that they could generate a false positive.

bobrik commented 8 years ago

Updated with atypical mode.

bobrik commented 8 years ago

Also rebased and added changelog entry.

untergeek commented 8 years ago

Improving the documentation examples would be all that's left to make this right.

bobrik commented 8 years ago

Added backticks

untergeek commented 8 years ago

Excellent! Merging now.

elasticsearch-bot commented 8 years ago

Aaron Mildenstein merged this into the following branches!

Branch Commits
master bd860c2d6dca30dd747f1ea0e9b1b915eb57f6dc