watch out when you modify /etc/ttys !!
dbj.rice%rand-relay at sri-unix.UUCP
dbj.rice%rand-relay at sri-unix.UUCP
Mon Jun 13 09:44:50 AEST 1983
From: Dave Johnson <dbj.rice at rand-relay>
UCB Mail does a getlogin() to decide who to say the message is "From:", and
if this returns a NULL, it instead tries a getpwuid(getuid()). Getlogin
uses ttyslot() to find the "slot" number of this tty in /etc/ttys, and then
uses this number also as the slot number in /etc/utmp (init maintains
/etc/utmp in order of tty "slot" number as returned by ttyslot()). Thus, if
you change /etc/ttys, you change what value is returned by ttyslot(), and
thus, getlogin() starts looking at a different entry in /etc/utmp than was
used to record when this person logged on to this terminal. Presumably,
Mail thought it was faster to read through /etc/ttys than to read all of
/etc/passwd to translate the uid...
It should be "safe" to add new entries to the bottom of /etc/ttys. To
"delete" lines from /etc/ttys, you can just put a "0" as the first character
on the line and everybody will ignore that line.
Dave Johnson
Dept. of Math Science
Rice University
More information about the Comp.unix.wizards
mailing list