I have a executable running in the background accepting requests into a queue it has created and sending responses back to the calling queue. If I call another executable to send the requests and wait for the response, the program works. If I have another user run the 2nd executable they cannot even open the queue created in the first exectuable. They get an error message that permission was denied when attempting to open the queue. Why does this only work if the same user is creating and accessing the queue. Please help...
Code from the executable which created the queue.
#define PMODE 0666
char * zipque = "/verifyaddr";
inmqd = mq_open(zipque, O_CREAT|O_RDWR, PMODE, &attr);
if (inmqd == (mqd_t)(-1)){
perror("Error opening zipqueue" /*No problem here*/
exit(0);
}
printf("Waiting for messages\n"
/* Loop forever accepting requests into the queue */
do
{......}
Code from the executable which sends requests (permission problem here)
md = mq_open("/verifyaddr", O_RDWR);
if (md == (mqd_t)-1){
perror("Couldn't open the message queue"
mq_unlink(qname);/* from the queue created to accept only qname is based on process id number*/
mq_close(me);
exit(1);
}
(This only works if the same user who created the 'verifyaddr' queue is sending and receiving from it.
Code from the executable which created the queue.
#define PMODE 0666
char * zipque = "/verifyaddr";
inmqd = mq_open(zipque, O_CREAT|O_RDWR, PMODE, &attr);
if (inmqd == (mqd_t)(-1)){
perror("Error opening zipqueue" /*No problem here*/
exit(0);
}
printf("Waiting for messages\n"
/* Loop forever accepting requests into the queue */
do
{......}
Code from the executable which sends requests (permission problem here)
md = mq_open("/verifyaddr", O_RDWR);
if (md == (mqd_t)-1){
perror("Couldn't open the message queue"
mq_unlink(qname);/* from the queue created to accept only qname is based on process id number*/
mq_close(me);
exit(1);
}
(This only works if the same user who created the 'verifyaddr' queue is sending and receiving from it.