[lcdproc] Configuration File Syntax (proposed)

David Douthitt n9ubh@callsign.net
Thu, 20 Sep 2001 12:38:57 -0400


Rene Wagner wrote:
> 
> -thos wrote:
> 
> > RW> LCDd does NOT have to run as root! Not even to initiate the drivers
> > RW> or something.
> >
> > Thats completely wrong.
> 
> No, not completely. It is true for serial devices. My LCD is a serial
> one and I simply forgot about the parallel port devices.
> 
> > I wrote a driver for my Toshiba T6963 and it needs
> > parallel port access. This is done directly because /dev/parport is simply to
> > slow.
> 
> Of course you're right! With parallel devices LCDd must be run as root.

Actually, it doesn't matter - just program it in this way:

1. If it IS run as root, drop root privs as soon as possible using
setuid(3).

2. If not running as root, check the for EACCES from open(2) in the
driver; if you get this error, exit with a message such as:

    error: access to <device> was denied.
    error: perhaps LCDd should be run as root?

The end results are:

1. The LCDd daemon doesn't run normally as root
2. The drivers, if required, holler and ask for root access to devices

No sweat.  Remember, during automatic startup, all programs are run as
root to begin with.


-----------------------------------------------------------
To unsubscribe from this list send a blank message to
lcdproc-unsubscribe@lists.omnipotent.net