From owner-freebsd-bugs Sun May 3 02:42:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA05228 for freebsd-bugs-outgoing; Sun, 3 May 1998 02:42:20 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA05220 for ; Sun, 3 May 1998 02:42:18 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id CAA24375; Sun, 3 May 1998 02:40:02 -0700 (PDT) Received: from dt050n33.san.rr.com (Studded@dt050n33.san.rr.com [204.210.31.51]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA03483 for ; Sun, 3 May 1998 02:33:17 -0700 (PDT) (envelope-from dougdougdougdoug@dt050n33.san.rr.com) Received: (from dougdougdougdoug@localhost) by dt050n33.san.rr.com (8.8.8/8.8.8) id JAA03244; Sun, 3 May 1998 09:33:18 GMT (envelope-from dougdougdougdoug) Message-Id: <199805030933.JAA03244@dt050n33.san.rr.com> Date: Sun, 3 May 1998 09:33:18 GMT From: Studded@san.rr.com Reply-To: Studded@san.rr.com To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/6492: telnetd "/etc/issue-like" support Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 6492 >Category: bin >Synopsis: telnetd support for an /etc/issue file and bug fix >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun May 3 02:40:01 PDT 1998 >Last-Modified: >Originator: Doug >Organization: AAAG >Release: FreeBSD 2.2.6-STABLE-0502 i386 >Environment: -Stable and -Current >Description: Support for reading the "if" file from /etc/gettytab was included in -Current on 4/26/98 but not -Stable. A simple diff between -Current and -Stable applies, compiles and runs cleanly so I'd like to encourage someone to commit it. In addition, while testing that facility it became apparent that when telnetd printed it to the remote terminal it was missing a \r. This causes the file to be printed out with the dreaded stairstep effect. The supplied patch to utility.c (in the telnetd directory) should be applied to both -Current and -Stable. >How-To-Repeat: For -Current, create a multi-line file referenced with the "if=" option in /etc/gettytab. Telnet in from a remote site and watch the file stairstep across the terminal. :) >Fix: Apply the following patches: This one is straight from CVS, only needed on -Stable diff -p -u -r1.7.2.4 -r1.14 --- src/libexec/telnetd/telnetd.c 1998/03/06 01:47:55 1.7.2.4 HEAD +++ /home/ncvs/src/libexec/telnetd/telnetd.c 1998/04/26 06:51:36 1.14 @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)telnetd.c 8.2 (Berkeley) 12/15/93"; #endif static const char rcsid[] = - "$Id: telnetd.c,v 1.7.2.4 1998/03/06 01:47:55 jkh Exp $"; + "$Id: telnetd.c,v 1.14 1998/03/06 01:47:55 jkh Exp $"; #endif /* not lint */ #include "telnetd.h" @@ -60,6 +60,8 @@ static const char rcsid[] = #include #include +#include + #if defined(_SC_CRAY_SECURE_SYS) #include #include @@ -892,6 +894,11 @@ telnet(f, p, host) char *HE; char *HN; char *IM; + char *IF; + char *if_buf; + int if_fd; + struct stat statbuf; + void netflush(); /* @@ -1090,8 +1097,11 @@ telnet(f, p, host) HE = getstr("he", &cp); HN = getstr("hn", &cp); IM = getstr("im", &cp); + IF = getstr("if", &cp); if (HN && *HN) (void) strcpy(host_name, HN); + if (IF && (if_fd = open(IF, O_RDONLY, 000)) != -1) + IM = 0; if (IM == 0) IM = ""; } else { @@ -1101,6 +1111,14 @@ telnet(f, p, host) edithost(HE, host_name); if (hostinfo && *IM) putf(IM, ptyibuf2); + else if (IF && if_fd != -1) { + fstat (if_fd, &statbuf); + if_buf = (char *) mmap (0, statbuf.st_size, PROT_READ, + 0, if_fd, 0); + putf(if_buf, ptyibuf2); + munmap (if_buf, statbuf.st_size); + close (if_fd); + } if (pcc) (void) strncat(ptyibuf2, ptyip, pcc+1); This one should be attributed to Chip Norkus and applied to both branches: --- utility.c.Dist Sun May 3 01:36:55 1998 +++ utility.c Sun May 3 01:57:41 1998 @@ -441,7 +441,12 @@ putlocation = where; while (*cp) { - if (*cp != '%') { + if (*cp =='\n') { + putstr("\r\n"); + cp++; + continue; + } + else if (*cp != '%') { putchr(*cp++); continue; } >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message