-
Notifications
You must be signed in to change notification settings - Fork 3
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
semaphore permissions: Trying to set 0o666 results in 0o664 instead #8
Comments
The permissions settings are masked against the process |
Thanks for your quick response! I understand that using default permissions (via umask) is a good idea, but I explicly specify the permissions so I expect them to be that way. But it's pointless to whine because as I now see the masking is happening in sem_open ... :-( |
In d9d91b0, I have added the old_msk = umask(0) # set umask, remembering old value
sem = Semaphore(sem_name, 1; volatile=false, perms=0o666) # open semaphore
umask(old_msk) # restore old umask value This should create the semaphore file with correct permissions. For now I have update the doc. to mention that the Perhaps it is better if this is automatically done under the hood by Once we decide on this, I can make a new release. |
To satisfy both expectations (mine to get what I specified and on the other hand people expecting sem_open's behaviour) you could make Semaphore() do the umasking under the hood, but let open(Semaphore,...) stick to sem_open / POSIX. |
Done in 22d3a48. Thanks for the suggestion. I will register a new version as soon as I can get the documentation built again... |
Done. |
Hi everyone!
When trying this:
The resulting semaphore in /dev/shm/ has permissions 0o664 instead of 0o666
Using Julia 1.10.0 and Ubuntu 2204
Best regards
Oliver
The text was updated successfully, but these errors were encountered: