Ingo Flaschberger <email@example.com>,
In a message on Tue, 28 Jan 2003 01:59:15 +0100 (MET), wrote :
IF> > I have successfully taken code from your examples and written a program that
IF> > makes the output lines of the printer port go hi/low as desired and toggle a
IF> > relay.
IF> > Now, I have two more problems:
IF> > Gora - what you said is correct; I have to be root to get your program to
IF> > work. Otherwise, I get a "segmentation fault" error. How can I get around
IF> > this?
IF> > I need to have Apache (which runs as wwwrun) execute this code in my cgi-bin
IF> > directory. I'm setting this up so when someone clicks on a bar
IF> > on the webpage, it pulls in a relay.
IF> suid-bit? -> http://www.linuxgeek.net/index.pl/suid
Better: chown/chmod of /dev/lp?
The suid-bit is seriously *dangerious*. All it takes is a silly
buffer-overrun bug and a seriously clever cracker and your system is
Changing the ownership and/or protection of a file in /dev is far
safer. The *kernel* does not really care what the UID/GID of the
process doing I/O, so long as the process has *permission* to do the
I/O. This is handled by matching the process's effective UID/GID to
the ownership and protection (mode) of the I/O dev file in question.
This is in fact what the owner and mode bits are there for.
IF> -- To unsubscribe, send mail to: firstname.lastname@example.org --
IF> -- with the single word "unsubscribe" in the body of the message. --
Robert Heller ||InterNet: email@example.com
http://vis-www.cs.umass.edu/~heller || firstname.lastname@example.org
http://www.deepsoft.com /\FidoNet: 1:321/153
-- To unsubscribe, send mail to: email@example.com --
-- with the single word "unsubscribe" in the body of the message. --
This archive was generated by hypermail 2b29 : Mon Jan 27 2003 - 21:26:36 EST