freebsd-dev/libexec/getty
Alexey Dokuchaev f73ff060d2 Try to fix the old "he capability is stupid" bug in gettytab(5)/getty(8)
There is one capability explicitly documented in gettytab(5) as stupid: he.
And it is indeed.  It was meant to facilitate system hostname modification,
but is hardly usable in practice because it allows very limited editing
(e.g., it depends on a particular hostname length, making it non-generic).

Replace it with simple implementation that treats ``he'' as POSIX extended
regular expression which is matched against the hostname.  If there are no
parenthesized subexpressions in the pattern, entire matched string is used
as the final hostname.  Otherwise, use the first matched subexpression.
If the pattern does not match, the original hostname is not modified.

Using regex(3) gives more freedom, does not complicate the code very much,
and makes a lot more sense, in turn making ``he'' less stupid and actually
useful (e.g., it is now possible to obtain node or domain names from the
original hostname string, without knowing it in advance).

Reviewed by:		jilles, manpages (wblock)
Approved by:		jilles (implied)
Differential Revision:	https://reviews.freebsd.org/D9244
2017-02-02 20:30:50 +00:00
..
chat.c In libexec/getty/chat.c, replace && with & in chat_send(). The intent 2011-12-16 15:44:12 +00:00
extern.h Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
getty.8 Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
gettytab.5 Try to fix the old "he capability is stupid" bug in gettytab(5)/getty(8) 2017-02-02 20:30:50 +00:00
gettytab.h Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
init.c Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
main.c Remove LOG_ODELAY because it does nothing. 2014-08-17 19:06:26 +00:00
Makefile Convert to LIBADD 2014-11-25 21:18:18 +00:00
Makefile.depend Add META_MODE support. 2015-06-13 19:20:56 +00:00
pathnames.h Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
subr.c Try to fix the old "he capability is stupid" bug in gettytab(5)/getty(8) 2017-02-02 20:30:50 +00:00
ttys.5 ttys(5): Pseudo-terminals are not listed and the network keyword is obsolete. 2014-03-09 22:38:11 +00:00