From 0c285f22c3affa002a778bb4705b2f3b152cb998 Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Tue, 24 May 1983 23:21:42 -0800 Subject: [PATCH] banner moves out of login SCCS-vsn: libexec/telnetd/telnetd.c 4.21 --- usr/src/libexec/telnetd/telnetd.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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; -- 2.20.1