Subject: Re: /dev/console
To: None <>
From: Holger Veit I5.EDS <>
List: current-users
Date: 04/08/1994 15:19:38
> > re: /etc/fbtab-type-thing
> > 
> > i've been thinking of something like /dev/fbtab, but not for the same
> > reasons.  however, that format has some problems, and i'm not sure
> > the right way to address them yet...
> For instance, in a Sunish console environment it's fine to say the user
> sitting at the machine gets ownership of /dev/console, /dev/fb, etc.
> They also have it simpler becuase there isn't any thing like the 
> /dev/console vs /dev/vga (vs /dev/ttyv0).
> But with something like pcvt, what if they login under multiple usernames?
> But I agree, ownership of things like /dev/console is a problem (minor but
> niggling) with the current scheme.  ACL's, yeah, that's it.  Forget
> FFS, we'll just use RMS.  Then we won't need the db library any more
> either ?-).
> -Mark
You are absolutely right, the whole /dev/console | /dev/vga | dev/ttyv0 
stuff is ill specified. IMHO, no process should not be able to capture
/dev/console for normal tty IO at all.
The current method is to give this to root with mode 600, to prevent
attaching it by non-privileged programs. The difficulty is that the 
/dev/console has the alter ego /dev/vga | /dev/ttyv0 (or /dev/com1) 
and adopts this identity when a privileged process grabs one of them.
This happens when for instance xdm is started on the console and does not
detach from /dev/console: the non-root user won't be able to run
xconsole (or xterm -C) on his X11 desktop because the console is not owned
by him.

What if the following were possible:
Make /dev/console a pseudodevice that blocks certain ioctls
(like TIOCCONS) and passes data *written* to it to every process that
requests data (i.e. "opens" the device). The console would provide a 
tty/pty pair to make a connection to the requesting process, and 
distributes the messages sent to it to all active connections (rather
than to the currently only one process that "has" the console now).
There is a predefined physical device that is connected to this
console by default (here vga or ttyv0 or com1).
Unlike SunOS etc. no getty is run on /dev/console, but it may be run
on the default connection.
To summarize: The new console device is a distribution unit if there
are multiple readers, and no writer can allocate it or the physical
unit connected to it.

         Dr. Holger Veit                   | INTERNET:
|  |   / GMD-SET German National Research  | Phone: (+49) 2241 14 2448
|__|  /  Center for Computer Science       | Fax:   (+49) 2241 14 2342
|  | /   Schloss Birlinghoven              | Had a nightmare yesterday:
|  |/    53754 St. Augustin, Germany       | My system started up with
                                           | ... Booting vmunix.el ...