Kerubu
June 16th, 2010, 08:54 AM
I'm writing some programs that use the libusb libraries to access usb devices using code written in user space. However with just normal user privileges the functions my program can do are limited e.g. I cannot even open a device.
To open a device I have to execute my program with 'sudo' to give it superuser rights. Now yes I know this is bad programming but it's only a temporary measure.
But what I'd like to know is how can I or what code do I need to include for the program to check what privileges it has when it is executed?
Many thanks
Kerubu
To open a device I have to execute my program with 'sudo' to give it superuser rights. Now yes I know this is bad programming but it's only a temporary measure.
But what I'd like to know is how can I or what code do I need to include for the program to check what privileges it has when it is executed?
Many thanks
Kerubu