[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rxtx
Subject:    [Rxtx] Parallel port access as non root user?
From:       "Ed Young" <ejy () SummitBid ! com>
Date:       2006-09-21 11:20:43
Message-ID: dec552570609210420xfe58cbaqd0776fb3e58d38bd () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I'm doing some preliminary testing to figure out how I can control the
parallel port with RxTx.

Basically, I'm trying to access the parallel port (/dev/lp0) from a non root
process.

Basically I have a program that can only access the port if it runs as root.

Here's what happens when I run as root:
root@falcon:~/src/k74- 1.0# ./pprxtx all set
root@falcon:~/src/k74-1.0# ./pprxtx read
255
root@falcon:~/src/k74-1.0# ./pprxtx all clear
root@falcon:~/src/k74-1.0# ./pprxtx read
0

Here's what happens when I run as a non root user (ed):
ed@falcon:~/src/k74-1.0$ ./pprxtx all set
/dev/port: Permission denied
ed@falcon:~/src/k74-1.0$ ./pprxtx read
/dev/port: Permission denied

/dev/lp0 I thought that all I had to do was to add my non rootport  user to
the device group (lp) in /etc/group and then that user would have
permissions to read and write to that device.
lp:x:7:cupsys, ed

I also changed the device permissions to
  /dev:
  crw-rw-rw- 1 root lp 6, 0 2006-09-21 04:56 lp0

I still can't access the port unless I run as root.

If I change the /dev/port (dangerously insecure) permissions to
  /dev:
  crw-rw-rw- 1 root kmem 1, 4 2006-09-21 04:56 port

I then get:
ed@falcon:~/src/k74-1.0$ ./pprxtx read
/dev/port: Operation not permitted
ed@falcon:~/src/k74-1.0$ ./pprxtx all set
/dev/port: Operation not permitted

Any ideas? I've done a fair amount of googling this and it seems like I'm
doing everything correctly.

Thanks,

-- 
Ed

[Attachment #5 (text/html)]

I'm doing some preliminary testing to figure out how I can control the parallel port \
with RxTx. <br><br>Basically, I'm trying to access the parallel port (/dev/lp0) from \
a non root process. <br><br>Basically I have a program that can only access the port \
if it runs as root.  <br>Here's what happens when I run as \
root:<br>root@falcon:~/src/k74- 1.0# ./pprxtx all set<br>root@falcon:~/src/k74-1.0# \
./pprxtx read<br>255<br>root@falcon:~/src/k74-1.0# ./pprxtx all \
clear<br>root@falcon:~/src/k74-1.0# ./pprxtx read<br>0<br><br>Here's what happens \
when I run as a non root user (ed): <br>ed@falcon:~/src/k74-1.0$ ./pprxtx all \
set<br>/dev/port: Permission denied<br>ed@falcon:~/src/k74-1.0$ ./pprxtx \
read<br>/dev/port: Permission denied<br><br>/dev/lp0 I thought that all I had to do \
was to add my non rootport&nbsp; user to the device group (lp) in /etc/group and then \
that user would have permissions to read and write to that device. <br>lp:x:7:cupsys, \
ed<br><br>I also changed the device permissions to <br>&nbsp; /dev:<br>&nbsp; \
crw-rw-rw- 1 root lp 6, 0 2006-09-21 04:56 lp0<br><br>I still can't access the port \
unless I run as root.  <br><br>If I change the /dev/port (dangerously insecure) \
permissions to  <br>&nbsp; /dev:<br>&nbsp; crw-rw-rw- 1 root kmem 1, 4 2006-09-21 \
04:56 port<br><br>I then get: <br>ed@falcon:~/src/k74-1.0$ ./pprxtx \
read<br>/dev/port: Operation not permitted<br>ed@falcon:~/src/k74-1.0$ ./pprxtx all \
set<br>/dev/port: Operation not permitted <br><br>Any ideas? I've done a fair amount \
of googling this and it seems like I'm doing everything correctly. <br><br>Thanks,<br \
clear="all"><br>-- <br>Ed



_______________________________________________
Rxtx mailing list
Rxtx@qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic