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

out_file: don't create world writable directory in daemon mode #483

Merged
merged 1 commit into from
Nov 22, 2014

Conversation

kou
Copy link
Contributor

@kou kou commented Nov 21, 2014

How to reproduce:

Create the following config file as file-fluentd.conf:

<source>
  type forward
</source>

<match **>
  type file
  path /tmp/x/y/z/a
</match>

Start fluentd:

% ruby -I lib bin/fluentd -c file-fluentd.conf --daemon fluentd.pid

Check permission of /tmp/x:

% stat /tmp/x | grep Access
Access: (0777/drwxrwxrwx)  Uid: ( 1000/     kou)   Gid: ( 1000/     kou)
Access: 2014-11-21 17:15:59.898444064 +0900

Permission is "0777/drwxrwxrwx".

Because daemon mode changes umask to 0000. (It's natural for daemon.)

How to reproduce:

Create the following config file as file-fluentd.conf:

    <source>
      type forward
    </source>

    <match **>
      type file
      path /tmp/x/y/z/a
    </match>

Start fluentd:

    % ruby -I lib bin/fluentd -c file-fluentd.conf --daemon fluentd.pid

Check permission of /tmp/x:

    % stat /tmp/x | grep Access
    Access: (0777/drwxrwxrwx)  Uid: ( 1000/     kou)   Gid: ( 1000/     kou)
    Access: 2014-11-21 17:15:59.898444064 +0900

Permission is "0777/drwxrwxrwx".

Because daemon mode changes umask to `0000`. (It's natural for daemon.)
repeatedly added a commit that referenced this pull request Nov 22, 2014
out_file: don't create world writable directory in daemon mode
@repeatedly repeatedly merged commit 25b96ef into fluent:master Nov 22, 2014
@repeatedly
Copy link
Member

Thanks!

@kou kou deleted the out-file-fix-world-writable-directory branch November 22, 2014 15:04
@sonots
Copy link
Member

sonots commented Nov 24, 2014

cherry-picked to v0.10 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants