natefinch / lumberjack

lumberjack is a log rolling package for Go
MIT License
4.8k stars 591 forks source link

Set umask in linux_test.go #20

Closed tpot closed 7 years ago

tpot commented 8 years ago

Hi there. This particular test fails in my environment as my umask is set to 0022. This patch sets the umask for the test to be something that will allow the test to pass.

natefinch commented 8 years ago

This is not really the best fix for the problem. Setting umask in the code is kind of a no-no. I think the problem is actually that the tests are trying to create a directory with too lax permissions... all they need is 0600, and they're getting created with 0777: https://github.com/natefinch/lumberjack/blob/v2.0/lumberjack_test.go#L638

So, I think just changing that code to use 0600 should fix it for you. You're welcome to give it a try, or I will when I get a few minutes.

lewisthompson commented 7 years ago

Would be great to get this test fixed as it currently fails builds for me also.

natefinch commented 7 years ago

crud, thanks for pinging me about this. I'll get it fixed ASAP.