From owner-freebsd-bugs Mon Apr 20 12:20:09 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA19713 for freebsd-bugs-outgoing; Mon, 20 Apr 1998 12:20:09 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA19661; Mon, 20 Apr 1998 12:20:05 -0700 (PDT) (envelope-from gnats) Received: from easton-15.student.umd.edu (init@easton-15.student.umd.edu [129.2.140.15]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA17820 for ; Mon, 20 Apr 1998 19:14:36 GMT (envelope-from init@easton-15.student.umd.edu) Received: (from init@localhost) by easton-15.student.umd.edu (8.8.7/8.8.7) id PAA11230; Mon, 20 Apr 1998 15:14:29 -0400 (EDT) (envelope-from init) Message-Id: <199804201914.PAA11230@easton-15.student.umd.edu> Date: Mon, 20 Apr 1998 15:14:29 -0400 (EDT) From: init@risen.org Reply-To: init@risen.org To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/6365: Patch to allow telnetd to recognize if gettytab flag Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 6365 >Category: bin >Synopsis: Patch to allow telnetd to recognize if gettytab flag >Confidential: yes >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Apr 20 12:20:01 PDT 1998 >Last-Modified: >Originator: Jason Garman >Organization: >Release: FreeBSD 2.2.5-RELEASE i386 >Environment: >Description: telnetd does not recognize the if (display file before login) gettytab flag. >How-To-Repeat: add an if= entry to the gettytab database and telnet into your machine. It is ignored. >Fix: Patch for 2.2.5 telnetd follows: --- telnetd.c.old Mon Apr 20 14:47:38 1998 +++ telnetd.c Mon Apr 20 15:02:49 1998 @@ -60,6 +60,8 @@ #include #include +#include + #if defined(_SC_CRAY_SECURE_SYS) #include #include @@ -892,6 +894,11 @@ char *HE; char *HN; char *IM; + char *IF; + char *if_buf; + int if_fd; + struct stat statbuf; + void netflush(); /* @@ -1090,8 +1097,11 @@ 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,7 +1111,14 @@ 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); ptyip = ptyibuf2; >Audit-Trail: >Unformatted: no To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message