Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Bind on Netlink Socket Results in Operation Not Permitted Error

    Distro: RHEL 5.6
    Language: C
    Libraries: libusbx-1.0

    I'm currently rewriting a USB driver daemon for a 6dof device to utilize the libusbx library. When I begin initialization of the libusb library using libusb_init(NULL) with full debug turned on, I receive an error indicating that the bind function is returning errno 1 (Operation not Permitted) when the library attempts to bind a netlink socket (I disabled udev use in libusb since our hosts don't have libudev on them). The daemon is started by a generic user account.

    If I su as root and kick off the daemon, the bind works and the code goes on.

    So far, the only solution I can find is to either run the daemon as root or give the user account temporary root privileges via sudo or setuid(). The daemon has to be kicked off by the user account.

    Are there any other ways to have a daemon bind to a netlink socket without having to use root privileges? Do you think if I were to copy the systemd library onto the host and enable udev that I would have the same issue? If I did add systemd and enabled udev for the libusbx library, would I have to add udev rules?

    I know there are probably better forums out there to ask this question, but I figured I'd come back after 6 years (!) to see who's around and if some of the gurus here had experience with libusb or linux and socket permissions.

    Thanks for any guidance on this issue. If you don't have any, I'll see ya in another 6 years to see if we have some better gurus

    -Shane

  • #2
    Senior Coder TheShaner's Avatar
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Posts
    1,126
    Thanks
    2
    Thanked 40 Times in 40 Posts
    Quote Originally Posted by theshaner6 View Post
    I know there are probably better forums out there to ask this question, but I figured I'd come back after 6 years (!) to see who's around and if some of the gurus here had experience with libusb or linux and socket permissions.

    Thanks for any guidance on this issue. If you don't have any, I'll see ya in another 6 years to see if we have some better gurus
    So I posted under the wrong user name. And it hasn't been 6 years but more like 2 or 3 years. I guess that user name was for when the forums were hacked and the hacker had banned this name for a little bit until a Mod was able to un-ban it back in 2007.

    -Shane


  •  

    Posting Permissions

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