Does umask affect message queues?
In Ubuntu Linux, does changing umask of the system (by calling umask() in a program for example), affect the creation and usage of the IPC facilities like message q开发者_如何学Goueues on the system?
From the man page
The umask setting also affects the permissions assigned to POSIX IPC objects (mq_open(3), sem_open(3), shm_open(3)), FIFOs (mkfifo(3)), and UNIX domain sockets (unix(7)) created by the process. The umask does not affect the permissions assigned to System V IPC objects created by the process using msgget(2), semget(2), shmget(2)).
So if your IPC uses the above, then yes. Can you be more specific?
strace myprogram | egrep 'mq_open|sem_open|...'
should tell you if you're calling any of these, directly or indirectly.
精彩评论