Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: binary MIME-Version: 1.0 X-Mailer: MIME-tools 5.411 (Entity 5.404) X-RT-Original-Encoding: iso-8859-1 Content-Length: 3302 From donn@u.washington.edu Tue May 20 11:03:12 1997 Received: from MIT.EDU (SOUTH-STATION-ANNEX.MIT.EDU [18.72.1.2]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id LAA01644 for ; Tue, 20 May 1997 11:03:12 -0400 Received: from melville.u.washington.edu by MIT.EDU with SMTP id AA00999; Tue, 20 May 97 11:03:11 EDT Received: (from donn@localhost) by melville.u.washington.edu (8.8.4+UW97.04/8.8.4+UW97.05) id IAA89766; Tue, 20 May 1997 08:03:10 -0700 Message-Id: <199705201503.IAA89766@melville.u.washington.edu> Date: Tue, 20 May 1997 08:03:10 -0700 From: donn@u.washington.edu Reply-To: donn@u.washington.edu To: krb5-bugs@MIT.EDU Subject: telnetd banner (BSD 4.4!!?) X-Send-Pr-Version: 3.99 >Number: 430 >Category: krb5-appl >Synopsis: Telnetd banner erroneously proclaims BSD 4.4 >Confidential: no >Severity: non-critical >Priority: medium >Responsible: krb5-unassigned >State: open >Class: change-request >Submitter-Id: unknown >Arrival-Date: Tue May 20 11:04:01 EDT 1997 >Last-Modified: >Originator: Donn Cave >Organization: University Computing Services University of Washington >Release: 1.0pl1 >Environment: Digital UNIX, Ultrix, AIX, HP/UX System: AIX melville 2 4 000010504900 >Description: Telnetd's login banner setup kind of revolves around the notion that it's going to come from /etc/gettytab, but the code that would actually do that is not compiled on any platform I have. The fallback recognizes an inadequate set of UNIX platforms and then defaults to BSD 4.4. While it's delightful to imagine that my AIX, Ultrix, HP/UX etc. computers could be miraculously transformed into BSD 4.4, the disappointing reality is that the banner lies, and we couldn't put that into production. So we put in something based on uname(), which seems to work fine (although as usually requires special attention on AIX.) >How-To-Repeat: Log in on something other than Solaris. >Fix: Context diff appended. ---------------------- *** src/appl/telnet/telnetd/telnetd.c.dist Fri Nov 8 14:25:20 1996 --- src/appl/telnet/telnetd/telnetd.c Wed Apr 16 13:11:39 1997 *************** *** 179,184 **** --- 179,204 ---- '\0' }; + #include + static void + osbanner(char *banner) + { + struct utsname name; + + if (uname(&name) < 0) + sprintf(banner, "\r\nError getting hostname: %s\r\n", + strerror(errno)); + else { + #if defined(_AIX) + sprintf(banner, "\r\n %%h (%s release %s.%s)\r\n\r\n", + name.sysname, name.version, name.release); + #else + sprintf(banner, "\r\n %%h (%s release %s %s)\r\n\r\n", + name.sysname, name.release, name.version); + #endif + } + } + main(argc, argv) int argc; char *argv[]; *************** *** 1211,1218 **** HEstr = 0; } edithost(HEstr, host_name); ! if (hostinfo && *IM) ! putf(IM, ptyibuf2); if (pcc) (void) strncat(ptyibuf2, ptyip, pcc+1); --- 1231,1243 ---- HEstr = 0; } edithost(HEstr, host_name); ! ! if (hostinfo && *IM) { ! char banner[4096]; ! osbanner(banner); ! putf(banner, ptyibuf2); ! /* putf(IM, ptyibuf2); */ ! } if (pcc) (void) strncat(ptyibuf2, ptyip, pcc+1); >Audit-Trail: >Unformatted: