New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus • Advice and insight from world-class Apple enthusiasts • Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Operation not permitted,


Post Reply New Thread Subscribe

 
Thread Tools
dfu

 
Member Since: Oct 15, 2012
Posts: 3
dfu is on a distinguished road

dfu is offline
Hi All,

I'm trying to run portscaner as part of my work at school. When I run the code it shows an error msg "Operation not permitted". This msg is printed directly after the OS fails to create a socket.

Notes:
1. my system is Mac OS X 10.6.8
2. in this project I'm using row socket.
3. I've written a code before the creates TCP socket and runs perfectly.

I assume this error appear because row sockets require some kind of higher privilege that my system currently has. Does anyone know how to change the privilege in my system?
Any helps is highly appreciated

Thanks,
DFU
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,081
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
Are you an Administrator on the machine? If so use sudo to run the comands..input your user password.

Craig Domingue - resident redneck.
“Never argue with an idiot. He will only bring you down to his level and beat you with experience.”, George Carlin
QUOTE Thanks
dfu

 
Member Since: Oct 15, 2012
Posts: 3
dfu is on a distinguished road

dfu is offline
Thanks cradom.

Yest, I'm the admin on the machine. Would you please advice me where to type sudo?

here is where the code stops:
Code:
ss->sockfd = socket(PF_INET, SOCK_RAW, IPPROTO_TCP);
	//int s = socket (AF_INET, SOCK_RAW, IPPROTO_RAW); to  to specify the IP header
	if (ss->sockfd == -1)
	{
		perror("Unable to create socket"); //  here the following is printed out: Unable to create socket, operation not permitted  
		return -1;
	}
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,081
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
You use sudo to run the command as a higher level. For example:
sudo netstat
Password: (type your user password here. you wont see it so make sure you type it right)
Have no idea about the code. Maybe someone else can check that?

Craig Domingue - resident redneck.
“Never argue with an idiot. He will only bring you down to his level and beat you with experience.”, George Carlin
QUOTE Thanks
dfu

 
Member Since: Oct 15, 2012
Posts: 3
dfu is on a distinguished road

dfu is offline
Thanks for your clarification.
I wrote the following in the command line and it works:
sudo ./myexecfile

Thanks again
QUOTE Thanks

Post Reply New Thread Subscribe


« App to modify the Mail program | Apple script »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
How deconstruct this Panic StevL OS X - Operating System 1 04-24-2012 05:38 PM
rmdir fails - "Operation not permitted " genecox OS X - Operating System 17 01-07-2012 05:45 PM
SMB Shares drop off automatically meth819 OS X - Operating System 0 02-28-2008 09:39 AM
SMTP and PHP MrGecko Web Design and Hosting 0 02-08-2008 02:50 PM
Something to unlock or just delete 3 locked folders Lamboo OS X - Apps and Games 9 01-30-2008 03:49 PM

All times are GMT -4. The time now is 01:58 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?