diff --git a/lib/fluent/env.rb b/lib/fluent/env.rb index d79ad7df3b..2916ff669d 100644 --- a/lib/fluent/env.rb +++ b/lib/fluent/env.rb @@ -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 diff --git a/lib/fluent/plugin/buf_file.rb b/lib/fluent/plugin/buf_file.rb index 342a41a872..e60fe8aa0a 100644 --- a/lib/fluent/plugin/buf_file.rb +++ b/lib/fluent/plugin/buf_file.rb @@ -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 diff --git a/lib/fluent/plugin/out_file.rb b/lib/fluent/plugin/out_file.rb index 1774bda177..92d0c134c2 100644 --- a/lib/fluent/plugin/out_file.rb +++ b/lib/fluent/plugin/out_file.rb @@ -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