Results 1 to 5 of 5
  1. #1
    Operation not permitted,

    Member Since
    Oct 15, 2012
    Posts
    3
    Operation not permitted,
    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

  2. #2
    Operation not permitted,
    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Nederland, Texas
    Posts
    4,082
    Specs:
    13in macbook - 10.10.4
    Are you an Administrator on the machine? If so use sudo to run the comands..input your user password.
    Craig Domingue
    (\__/)
    (='.'=) This is Bunny. Copy and paste Bunny into your
    (")_(") signature to help him gain world domination

  3. #3
    Operation not permitted,

    Member Since
    Oct 15, 2012
    Posts
    3
    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;
    	}

  4. #4
    Operation not permitted,
    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Nederland, Texas
    Posts
    4,082
    Specs:
    13in macbook - 10.10.4
    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
    (\__/)
    (='.'=) This is Bunny. Copy and paste Bunny into your
    (")_(") signature to help him gain world domination

  5. #5
    Operation not permitted,

    Member Since
    Oct 15, 2012
    Posts
    3
    Thanks for your clarification.
    I wrote the following in the command line and it works:
    sudo ./myexecfile

    Thanks again

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. one hand operation
    By Kirk K in forum Switcher Hangout
    Replies: 5
    Last Post: 05-09-2013, 12:18 PM
  2. Operation not permitted,
    By dfu in forum OS X - Operating System
    Replies: 0
    Last Post: 10-15-2012, 02:48 PM
  3. rmdir fails - "Operation not permitted "
    By genecox in forum OS X - Operating System
    Replies: 17
    Last Post: 01-07-2012, 05:45 PM
  4. Operation Mega-Compression
    By OnceYouGoMac in forum Switcher Hangout
    Replies: 4
    Last Post: 02-10-2010, 10:22 AM
  5. Error 1 - Operation not permited
    By Scorponok in forum OS X - Apps and Games
    Replies: 0
    Last Post: 09-15-2008, 10:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •