Skip site navigation (1)Skip section navigation (2)
Date:      14 Oct 1996 14:51:11 GMT
From:      "Nickolay N. Dudorov" <nnd@info.itfs.nsk.su>
To:        current@freebsd.org
Subject:   sgttyb vs. termios in current (?)
Message-ID:  <53tk0v$hse@news.itfs.nsk.su>

next in thread | raw e-mail | index | archive | help

	After installation of 961006-SNAP on one
of my systems I've made a kernel without COMPAT_43 option
and discover that 'rlogin' echo-ed my password ;-(

	Investigations of sources shows that some programs
still used (now obsoleted ?) sgtty headers and functions.

The main "home" of such programs is 'src/games'. There are:
	atc, backgammon, hack, larn, rain, rogue, snake,
tetris, trek, worms.

	Personaly I have no interest in rewriting any of this
toward termios (never have used any of them on FreeBSD ;).

	'src/usr.sbin' have some number of such programs also.
Stuff in 'xntpd/clockstuff' and 'pcvt/vttest' seems unused in
FreeBSD.

	'pcvt/fontedit' looks suspicious - it tests #ifdef BSD
(and uses sgttyb) before testing #if defined(__FreeBSD__).

'watch' unconditionally use sgttyb only (due to author's absence ?).

	In 'src/usr.bin' there is one unused(?) file in 'ee'
(ee/doc/new_curse.c).

	'src/usr.bin/talk/io.c' gives wanderfull example of
sgttyb use:

	ioctl(0, FIONREAD, (struct sgttyb *) &nb);

where nb is int ;-)
(so the text in inner parens can/must be deleted).

	The two programs which I have interest in
are 'rlogin' and 'lock'. Both of them was patched to use
'termios' in OpenBSD (may be in NetBSD also, but is there
(anon)CVS acces to NetBSD-current ?).

	I've made patches for FreeBSD-current based on OpenBSD
versions of rlogin and lock.

	If it is desirable, I can send-pr them.

	There is small problem with 'rlogin' - OpenBSD version
discard 'litout' mode from terminal settings and options parsing,
but not from options list and 'usage' message.
	In my patch I just ignore 'L' option, but
accept it (to avoid man page rewriting ;-).

	Another question with 'lock' sources in FreeBSD was rised by:
		s[0] = NULL;
assignment (with 'char s[BUFSIZ]' declaration). Corresponding line
in OpenBSD looks like:
		s[0] = '\0';
This is not a real 'bug' and I've not touch it in my patch, but
in current form it is not correct (and must be rewritten to, say:
		s[0] = 0;
to save 3 bytes * miriads of disks with FreeBSD sources ;-)

	N. Dudorov



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53tk0v$hse>