Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
12-05-2013, 03:44 AM #1
- Join Date
- Nov 2007
- Thanked 0 Times in 0 Posts
Bind on Netlink Socket Results in Operation Not Permitted Error
Distro: RHEL 5.6
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
12-05-2013, 03:51 AM #2
- Join Date
- Sep 2005
- Orlando, FL
- Thanked 40 Times in 40 Posts