LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-12-2008, 11:44 AM   #1
Steef223
LQ Newbie
 
Registered: Jun 2008
Posts: 2

Rep: Reputation: 0
Reading and Writing to a Serial Port without SU


Hello,

I am working with an application that needs to read and write to a serial port. Security is a major concern for this application, so I am having problems deciding what is the best way to allow a user without admin privileges to run the program. My experience with Linux is fairly limited.

I'm using Red Hat Enterprise Linux 4. When I do an ls -l /dev/ttyS*, all of them belong to the uucp group. I'm assuming I could just add the users to the uucp group, but that may introduce security vulnerabilities.

Alternatively, i've come across setuid() while searching for a solution, but that seems like another security problem, especially since my programming skills are sketchy, at best.

I should also add, the language being used is C.

Any advice would be greatly appreciated.

Thanks in advance!
 
Old 06-12-2008, 02:49 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
It is pretty easy to modify the ownership, group ownership, and privilege levels of the serial ports. Treat them like files, really. Create a group that includes the users that are permitted to use the port(s), and give the port(s) that group ownership.
--- rod.
 
Old 06-16-2008, 10:16 AM   #3
Steef223
LQ Newbie
 
Registered: Jun 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks Rod, sounds like great advice! I especially like it because it is simple and easy to implement.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Facing problems in reading from and writing to serial port. vineel Linux - Hardware 2 02-27-2008 03:18 PM
reading from serial port IC009562 Linux - Software 2 11-09-2007 12:25 AM
writing to serial port sea waves Programming 6 05-08-2007 12:59 PM
Having trouble reading from serial port glo Linux - Newbie 0 02-09-2007 11:42 AM
reading and writing to a serial device (modem) Xanadu Linux - Laptop and Netbook 0 01-04-2005 11:05 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration