-
Notifications
You must be signed in to change notification settings - Fork 19
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
Fix imaginator to fail if umask!=022. #449
Conversation
@@ -47,6 +47,10 @@ func main() { | |||
os.Exit(1) | |||
} | |||
logger := serverlogger.New("") | |||
if umask := syscall.Umask(022); umask != 022 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syscall.Umask
never fails but it returns the previous value. Why does it matter for imaginator what the old value was?
See the comment on the next line: since you can't cleanly and reliably set the umask in Go, it's simpler to fail if the umask isn't 022. |
I don't understand why one can't cleanly and reliably set the umask in Go... Is this related to Linux's infamously posix non-compliant threads implementation? Reading umask(2) man page I can see some words of warning about non-atomicity in multi-threaded programs when one only wants to read the umask value without changing it but that is not the case here. |
|
Indeed, I encountered this property of Linux before when trying to add I still don't understand the diff. If |
Again, the call to |
Got it, thanks. |
This relates to issue #445.