gogol
2011-05-21 13:53:11 UTC
I try to get a comm channel between the request handler of Apache2 and
another process referred to as app process. The request handler
process and the app process are owned by different users (request
handler process has uid of 1, the app process has uid of 1000). The
app process creates successfully a message queue with the following
code:
/* set the message queue attributes */
struct mq_attr attr;
attr.mq_maxmsg = max_msgs;
attr.mq_msgsize = max_msgsize;
attr.mq_flags = O_NONBLOCK;
errno = 0;
mqd_t msgQ = mq_open(
mqname, /* message queue name */
O_RDWR | O_NONBLOCK | O_CREAT | O_EXCL, /* oflag */
S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH |
S_IWOTH | S_IXOTH, /* mode */
&attr); /* attributes */
The request handler attempts to open that (existing) messaege queue
with:
mqd_t msgQ = mq_open(
mqname, /* message queue name */
O_RDWR | O_NONBLOCK); /* mode */
The attempt to open the existing message queue fails with errno=13 -
permission denied.
The opening of the existing message queue works fine if attempted from
a process that has the same owner as the process that created the
message queue - in this case the app process. Any help will be
appreciated. Thx.
another process referred to as app process. The request handler
process and the app process are owned by different users (request
handler process has uid of 1, the app process has uid of 1000). The
app process creates successfully a message queue with the following
code:
/* set the message queue attributes */
struct mq_attr attr;
attr.mq_maxmsg = max_msgs;
attr.mq_msgsize = max_msgsize;
attr.mq_flags = O_NONBLOCK;
errno = 0;
mqd_t msgQ = mq_open(
mqname, /* message queue name */
O_RDWR | O_NONBLOCK | O_CREAT | O_EXCL, /* oflag */
S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH |
S_IWOTH | S_IXOTH, /* mode */
&attr); /* attributes */
The request handler attempts to open that (existing) messaege queue
with:
mqd_t msgQ = mq_open(
mqname, /* message queue name */
O_RDWR | O_NONBLOCK); /* mode */
The attempt to open the existing message queue fails with errno=13 -
permission denied.
The opening of the existing message queue works fine if attempted from
a process that has the same owner as the process that created the
message queue - in this case the app process. Any help will be
appreciated. Thx.