LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-05-2013, 12:15 AM   #1
Niraj Kulkarni
Member
 
Registered: May 2008
Posts: 47

Rep: Reputation: 15
mq_open-> Permission denied


Hi,

I am facing "mq_open-> Permission denied" problem while trying to open POSIX message queue. Can any one tell me why "Permission denied".

Here are related information:

1. I am using Linux ubuntu 2.6.32-33.
2. Args passed to mq_open : mq_path = /root/mq,
oflag = O_CREAT|O_WRONLY,
mode = 0666
mq_attribute->mq_maxmsg = 1;
mq_attribute->mq_msgsize = 10;
mq_attribute->mq_flags = 0;
mq_attribute->mq_curmsgs = 0;
3. I am root.

Regards
Niraj Kulkarni.
 
Old 08-05-2013, 09:11 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,681

Rep: Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971
Quote:
Originally Posted by Niraj Kulkarni View Post
Hi,
I am facing "mq_open-> Permission denied" problem while trying to open POSIX message queue. Can any one tell me why "Permission denied". Here are related information:
1. I am using Linux ubuntu 2.6.32-33.
2. Args passed to mq_open : mq_path = /root/mq,
oflag = O_CREAT|O_WRONLY,
mode = 0666
mq_attribute->mq_maxmsg = 1;
mq_attribute->mq_msgsize = 10;
mq_attribute->mq_flags = 0;
mq_attribute->mq_curmsgs = 0;
3. I am root.
There are a few solutions posted, one on this site, but they center around (obviously enough), a permissions issue on the object, specifically either the mode or oflag:
http://www.linuxquestions.org/questi...ileges-867954/
http://manpages.ubuntu.com/manpages/....2freebsd.html
http://www.freag.net/en/t/3aaw7/mq_open_permiss

From the documentation:
Quote:
Originally Posted by mq_open Docs
O_WRONLY
Open the queue for sending messages. The process can use the returned message queue descriptor with the mq_send subroutine but not the mq_receive subroutine. A message queue may be open multiple times in the same or different processes for sending messages.
...and depending on how your program is working, that may explain it. If you're trying to use the mq_receive subroutine, it'll fail, but the send will work. Have you tried O_RDWR instead of O_WRONLY?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mkdir throws Permission Denied error in a directoy even with root ownership and 777 permission surajchalukya Linux - Security 14 09-03-2012 08:34 AM
Permission denied navsoftdev87 Linux - Newbie 3 01-27-2011 04:14 AM
permission denied DDK2669 Ubuntu 7 04-23-2009 01:59 PM
can't execute c++ binaries, "permission denied"... even though permission is 777 SerfurJ Programming 14 02-20-2009 04:50 AM
'permission denied" inspite of right permission flags on network drive anirudhvij Linux - Enterprise 8 05-22-2007 05:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration