Unable to open serial port when not super user
I have ubuntu 7.10 (Gutsy) on a 32-bit machine. My application communicates via serial ports with other attached devices. I am the lone and superuser on this machine and have had no trouble communicating via the serial ports. However, the application needs to be usable by ordinary users. So, I created a user with "sudo adduser ....". When this regular user attempts to run the application, the serial port cannot be opened and linux error 13 (permission denied) is seen. I have tried several things, including setting the uid bit (chmod 4755, chmod ug+s etc.) on the application and modifying euid inside the program before opening the port (seteuid()) but it does not work on ubuntu. I have sample code for this issue on a thread on the ubuntu forums at -
http://
What do I need to do in the code to enable a regular user to access privileged resources like serial ports (/dev/ttyS0) via the application?
All help will be greatly appreciated.
Thank you.
lu
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- marcobra (Marco Braida)
- Solved:
- Last query:
- Last reply: