Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, In user mode [non-root] linux machine, tried to bind a socket by using a "ioctl(iInterfaceSocket, SIOCSIFADDR, &stCommand)". I am getting error 13 -> Permission denied because of user mode. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2011
    Posts
    5

    user mode permission denied to bind to socket


    Hi,
    In user mode [non-root] linux machine, tried to bind a socket by using a "ioctl(iInterfaceSocket, SIOCSIFADDR, &stCommand)". I am getting error 13 -> Permission denied because of user mode. If change from usermode to kernel mode everything works fine.
    I need to bind the socket in user mode only, please suggest solution for the above
    while explaining the above, if I missed any information please inform, I will provide more info.
    Thanks
    Eswar

  2. #2
    Just Joined!
    Join Date
    May 2011
    Posts
    1
    try
    setuid(0);
    seteuid(0);

  3. #3
    Just Joined!
    Join Date
    May 2011
    Posts
    5
    Hi,
    I am able to solve the problem by the Function capset() set the effective and permitted capabilities of CAP_NET_RAW, CAP_NET_ADMIN. Please find the sample code ethereal.com/lists/ethereal-dev/200309/msg00265.html.

    Thanks for everybodies contribution which derived the solution.

    Thanks
    Eswar

Posting Permissions

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