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

mode() not setting file permissions correctly #665

Closed
gargooza opened this issue Jun 22, 2016 · 3 comments
Closed

mode() not setting file permissions correctly #665

gargooza opened this issue Jun 22, 2016 · 3 comments

Comments

@gargooza
Copy link

1.0.0~beta1 (git: master c6f7db5)

I have an alert that includes the following lines:
b|deadman(100.0, 15m) .id('Deadman') .message('{{ .ID }} is {{ .Level }}: {{ index .Fields "emitted" }} points seen in last 15m') .log('/tmp/Deadman.log') .mode(644)

I expected the resulting log file to have perms -rw-r--r-- but instead it has:
--w----r-- 1 kapacitor kapacitor 1.7K Jun 22 10:37 Deadman.log

@rossmcdonald
Copy link
Contributor

@gargooza Do you have the same issue if you update the mode to 0644? Based on the documentation, the .mode() node expects a 4-digit mode.

There definitely needs some more validation on the specified mode to prevent issues like this, though.

@gargooza
Copy link
Author

I am actually specifying 0644 as the mode when I define the task. What I pasted earlier was the output from a show task.

@nathanielc
Copy link
Contributor

@gargooza The bug is that the mode is being interpreted as a decimal number instead of an octal number. We should change it to accept a string that then gets interpreted as an base 8 number.

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

No branches or pull requests

3 participants