From: Sam Leffler Date: Wed, 25 May 1983 07:21:42 +0000 (-0800) Subject: banner moves out of login X-Git-Tag: BSD-4_2-Snapshot-Development~1778 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/0c285f22c3affa002a778bb4705b2f3b152cb998 banner moves out of login SCCS-vsn: libexec/telnetd/telnetd.c 4.21 --- diff --git a/usr/src/libexec/telnetd/telnetd.c b/usr/src/libexec/telnetd/telnetd.c index e5a040d4a2..ce69fa93a3 100644 --- a/usr/src/libexec/telnetd/telnetd.c +++ b/usr/src/libexec/telnetd/telnetd.c @@ -1,5 +1,5 @@ #ifndef lint -static char sccsid[] = "@(#)telnetd.c 4.20 83/05/22"; +static char sccsid[] = "@(#)telnetd.c 4.21 83/05/24"; #endif /* @@ -18,6 +18,7 @@ static char sccsid[] = "@(#)telnetd.c 4.20 83/05/22"; #include #include #include +#include #define BELL '\07' @@ -190,7 +191,7 @@ gotpty: dup2(t, 1); dup2(t, 2); close(t); - execl("/bin/login", "telnet-login", "-h", host, 0); + execl("/bin/login", "login", "-h", host, 0); fatalperror(f, "/bin/login", errno); /*NOTREACHED*/ } @@ -225,6 +226,7 @@ fatalperror(f, msg, errno) telnet(f, p) { int on = 1; + char hostname[32]; net = f, pty = p; ioctl(f, FIONBIO, &on); @@ -237,6 +239,12 @@ telnet(f, p) */ dooption(TELOPT_ECHO); myopts[TELOPT_ECHO] = 1; + /* + * Show banner that getty never gave. + */ + gethostname(hostname, sizeof (hostname)); + sprintf(nfrontp, BANNER, hostname, ""); + nfrontp += strlen(nfrontp); for (;;) { int ibits = 0, obits = 0; register int c;