Subject: Re: tty permissions
To: Dante Profeta <profeta@neomedia.it>
From: John D Duncan <jddst19+@pitt.edu>
List: netbsd-help
Date: 10/24/1996 10:50:22
[Dante's message follows]

in /dev/*, there are files with the b and c flags. They signify
either (b)lock or (c)haracter special-files. For example, /dev/sd0a
is a block-special-file, meaning that its access is in a block-
transfer mode. TTYs, on the other hand, operate as special-files
that accept streams, and so are character-special-files. 

Sadly enough, there is no documentation included with the dis-
trobution that would tell you this. However, they are in the
old 4.2BSD bedtime stories (PS2) and also in Dennis Ritchie's
chapter on writing device drivers for unix.

It is important that only the system, superuser, and the user are
able to access a tty, because private data is often transferred
through one. (What would be the use of receiving pgp mail if it was
readable by monitoring the tty a guy is using?) So those files are
set to be owned by the user who is on them. Login does this.
	"If the file _/etc/fbtab_ exists, :login: changes the
	protection and ownership of certain devices specified
	in this file."				[login(1)]

The file _/etc/fbtab_ is not necessary, it would seem, for this to
happen, as one does not exist on my machine, yet the behavior still
happens. _fbtab_ is used to set console and other permissions so that
certain non-root users can access certain devices excluded by normal
means. It says:
	"...the permissions of the devices in the ":"-
	delimited list are set as specified in the second
	field, and their ownership is changed to that of the
	uid and gid arguments."

So there you are :)

-jd


       ==============

jddst19+@pitt.edu   John Duncan
		    Freshman, University of Pittsburgh

"I'm not a doctor, but I ate one at the UPMC..."


On Thu, 24 Oct 1996, Dante Profeta wrote:

> I'm wondering about the behaviour of /dev/tty*
> 
> How do they works?
> 
> Why there are some ttys permissions with crw-rw-rw (generally owned by
> root, but some others owned by users), and some others with crw-------
> permissions (owned only by users)?
> 
> What is the 'c' bit? I've no docs about it.
> 
> Are there any security problems about ttys permissions?
> 
> Thanks a lot
> --
> __  ____
> _|\an|e_  profeta@neomedia.it
>