Skip to content

Commit

Permalink
Merge pull request #483 from kou/out-file-fix-world-writable-directory
Browse files Browse the repository at this point in the history
out_file: don't create world writable directory in daemon mode
  • Loading branch information
repeatedly committed Nov 22, 2014
2 parents 8c7bc1c + 19ae3d9 commit 25b96ef
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/fluent/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ module Fluent
DEFAULT_SOCKET_PATH = ENV['FLUENT_SOCKET'] || '/var/run/fluent/fluent.sock'
DEFAULT_LISTEN_PORT = 24224
DEFAULT_FILE_PERMISSION = 0644
DEFAULT_DIR_PERMISSION = 0755
end
2 changes: 1 addition & 1 deletion lib/fluent/plugin/buf_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def configure(conf)
end

def start
FileUtils.mkdir_p File.dirname(@buffer_path_prefix + "path")
FileUtils.mkdir_p File.dirname(@buffer_path_prefix + "path"), :mode => DEFAULT_DIR_PERMISSION
super
end

Expand Down
2 changes: 1 addition & 1 deletion lib/fluent/plugin/out_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def format(tag, time, record)

def write(chunk)
path = generate_path(chunk)
FileUtils.mkdir_p File.dirname(path)
FileUtils.mkdir_p File.dirname(path), :mode => DEFAULT_DIR_PERMISSION

case @compress
when nil
Expand Down

0 comments on commit 25b96ef

Please sign in to comment.