tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
login(1) vs "dialout ttys"
Hi,
while looking at usr.bin/login/login.c, I noticed the following strange
test:
if (tty[sizeof("tty")-1] == 'd')
syslog(LOG_INFO, "DIALUP %s, %s", tty, pwd->pw_name);
The intent seems obvious (if the name contains a 'd' in a position which
would agree with "ttyd", syslog that we have a dialup login) but it
seems to be a sloppy test which is furthermore incoherent with the
current naming of our devices. (It can't currently lead to an out of
bounds access because ttyname(3) returns a static PATH_MAX-length array)
After a quick look around, ttys(5) mentions ttyd0 as a dialout device in
its examples section, and the MAKEDEV.conf of the vax seems to avoid
ttyd in its enumeration of ttys, but on the other hand quite a handful
of ports use tty[a-d] as usual serial ports and logins on ttyd would
spam syslog uselessly.
Out of curiosity, I'm also interested to know if /dev/dtyxx is the new
incarnation of /dev/ttydxx or if they serve different purposes.
Also, checking with cvs annotate dug up a very old PR which induced the
removal of the test but the test was added back a few months later as a
merge of 4.4lite.
http://gnats.netbsd.org/377
So, before I remove the test (again), does anyone object? Does anyone
want to offer a more sensible test for the same intended purpose?
Regards,
Aymeric
Home |
Main Index |
Thread Index |
Old Index