views:

126

answers:

1

Hi all,

I have implemented a POSIX message queue. On the listener side, I am opening the queue like this:

mqdes = mq_open(s_mailbox_name.c_str(), O_RDONLY | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, NULL);

On the sender side, I am opening the queue like this:

mqdes = mq_open(m_s_mailbox_name.c_str(), O_WRONLY);

The string is the same on both, lets call it /foobox

Now, when I run both the sender and receiver as the same user on the box, everything works perfectly. However If the sender and receiver are 2 different users, the receiver can not open the queue. I would think this wouldn't be a problem because I am opening the queue as 0777 above so everyone can RWX.

Is there something obvious i'm doing wrong? Or is this not possible (Please don't let it be this one)

Thanks

+4  A: 

Check umask.

From man mq_open: "The permissions settings are masked against the process umask."

Tomek Szpakowicz
You're my hero, thanks :D, I can finally leave work now.
Salgar
You're welcome. Have a nice evening.
Tomek Szpakowicz