k12osn@redhat.com
[Top] [All Lists]

Re: [K12OSN] Error: Couldn't get the port at 378

Subject: Re: [K12OSN] Error: Couldn't get the port at 378
From: "James P. Kinney III"
Date: Tue, 10 Jun 2008 22:55:08 -0400
Doug,

Since you are writing directly to a device, the user must have write
access to that device. Root does but normal users don't. 

There are several ways to make this work. Ideally, you want to preserve
the system security but writing to the parallel port is maybe not a
security problem for your situation. If so, change the permissions on
the device to be 666 and everyone can read and write  to it.

A more elegant way is to modify the hal settings and have the device
initialize with the correct permissions. You will want to edit in the
udev settings. In redhat derivatives, it's in /etc/udev/rules.d . From
there you would make a new file that begins with a number higher than
the default file (so it gets run after -* double check this. I may have
it backwards.*) and model the config after the default section on
printer ports.

You can also set the application up so it is setuid root (chmod u+s
<filename>) but that may be an issue in a gui like gnome (It looks for
setuid root files and gripes as it _is_ a security risk).

Another option is to use sudo and setup that application for all users
to not require a password and then change the application name to
something like sudo-myapp and make a global alias myapp='sudo
sudo-myapp'.


On Tue, 2008-06-10 at 15:33 -0500, Doug Simpson wrote:
> Forgot to mention. . . linux, and Debian to be specific. . .
> 
> Doug Simpson
> Technology Specialist
> De Queen Public Schools
> De Queen, AR
> simpsond@xxxxxxxxxxxxxxxxxx
> "A Dollar Saved is a Dollar Earned"
> 
> 
> >>> "Doug Simpson" <simpsond@xxxxxxxxxxxxxxxxxx> 6/10/2008 3:30 PM >>>
> I have a program that lets you enter a command like:
> 
> lptout 233
> 
> and it passes the number to the parallel port and sets the data lines high 
> corresponding to the number you gave it.
> 
> The problem I am having is that when root runs the program, it runs fine.
> 
> When any other user runs it, it returns:
> 
> Error: Couldn't get the port at 378
> 
> like no one but root is allowed to use the parallel port.
> 
> Where would I look to fix this?
> 
> This same program works fine on every other computer I have tried it on but 
> this particular one. . .
> 
> There are two files for it:
> 
> lptout and lptout.c
> 
> Thanks for any assistance.
> 
> Doug
> 
> Doug Simpson
> Technology Specialist
> De Queen Public Schools
> De Queen, AR
> simpsond@xxxxxxxxxxxxxxxxxx 
> "A Dollar Saved is a Dollar Earned"
> 
> 
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN@xxxxxxxxxx 
> https://www.redhat.com/mailman/listinfo/k12osn 
> For more info see <http://www.k12os.org>
> 
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
> 
-- 
James P. Kinney III          
CEO & Director of Engineering 
Local Net Solutions,LLC                           
http://www.localnetsolutions.com

GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics)
<jkinney@xxxxxxxxxxxxxxxxxxxxx>
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

_______________________________________________
K12OSN mailing list
K12OSN@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/k12osn
For more info see <http://www.k12os.org>

<Prev in Thread] Current Thread [Next in Thread>