interprocess icon indicating copy to clipboard operation
interprocess copied to clipboard

Named mutex might not value permissions correctly

Open DasRoteSkelett opened this issue 6 years ago • 1 comments

Hi!

When using a named_mutex within POSIX, and setting the Permissions Object, everything boils down to an ::sem_open call. There, the permissions are passed. But ::sem_open masks the permissions with the processes umask. Therefore, the semaphore might not have 0666 permissions, but e.g. 644, even though, permissions were passed with set_unrestricted().

Workaround there would be setting umask to 0 before ::sem_open, and restoring again after. At least, this behaviour should be documented.

Regards,

Matthias

DasRoteSkelett avatar Apr 12 '19 14:04 DasRoteSkelett

Indeed, the chmod is commented here without any documentation or workaround described.

romainreignier avatar Feb 27 '24 11:02 romainreignier