From owner-freebsd-bugs@FreeBSD.ORG Mon Oct 24 23:50:16 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 461F516A41F for ; Mon, 24 Oct 2005 23:50:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 99DE543D48 for ; Mon, 24 Oct 2005 23:50:15 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j9ONoFPR075712 for ; Mon, 24 Oct 2005 23:50:15 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j9ONoFml075711; Mon, 24 Oct 2005 23:50:15 GMT (envelope-from gnats) Resent-Date: Mon, 24 Oct 2005 23:50:15 GMT Resent-Message-Id: <200510242350.j9ONoFml075711@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dan Ponte Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4DE2F16A41F for ; Mon, 24 Oct 2005 23:47:28 +0000 (GMT) (envelope-from dcp1990@styx.flinkpoyd.homeunix.com) Received: from eastrmmtao03.cox.net (eastrmmtao03.cox.net [68.230.240.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id A770C43D45 for ; Mon, 24 Oct 2005 23:47:27 +0000 (GMT) (envelope-from dcp1990@styx.flinkpoyd.homeunix.com) Received: from flinkpoyd.homeunix.com ([68.9.18.102]) by eastrmmtao03.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20051024234651.GSQG2767.eastrmmtao03.cox.net@flinkpoyd.homeunix.com> for ; Mon, 24 Oct 2005 19:46:51 -0400 Received: from styx.cox.net (dcp1990@localhost.danponte.net [127.0.0.1]) by styx.cox.net (8.13.4/8.13.4) with ESMTP id j9ONgQgf001844 for ; Mon, 24 Oct 2005 19:42:26 -0400 (EDT) (envelope-from dcp1990@styx.cox.net) Received: (from dcp1990@localhost) by styx.cox.net (8.13.4/8.13.1/Submit) id j9ONgQCq001843; Mon, 24 Oct 2005 19:42:26 -0400 (EDT) (envelope-from dcp1990) Message-Id: <200510242342.j9ONgQCq001843@styx.cox.net> Date: Mon, 24 Oct 2005 19:42:26 -0400 (EDT) From: Dan Ponte To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/87963: [PATCH] telnetd doesn't honour if= in gettytab X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Dan Ponte List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2005 23:50:16 -0000 >Number: 87963 >Category: bin >Synopsis: [PATCH] telnetd doesn't honour if= in gettytab >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: Mon Oct 24 23:50:15 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Dan Ponte >Release: FreeBSD 6.0-RC1 i386 >Organization: Unix Users Anonymous >Environment: System: FreeBSD styx.cox.net 6.0-RC1 FreeBSD 6.0-RC1 #23: Mon Oct 24 17:08:58 EDT 2005 root@styx.cox.net:/usr/obj/usr/src/sys/STYX i386 >Description: telnetd doesn't honour the if= parameter in gettytab (as documented). >How-To-Repeat: Use telnetd without this patch >Fix: Apply the following patch: --cut-- --- /usr/src/contrib/telnet/telnetd/otelnetd.c Thu Sep 1 13:35:05 2005 +++ /usr/src/contrib/telnet/telnetd/telnetd.c Sun Oct 16 14:06:13 2005 @@ -740,6 +740,7 @@ char *HE; char *HN; char *IM; + char *IF; int nfd; /* @@ -905,15 +906,41 @@ HE = Getstr("he", &cp); HN = Getstr("hn", &cp); IM = Getstr("im", &cp); + IF = Getstr("if", &cp); + if (HN && *HN) (void) strlcpy(host_name, HN, sizeof(host_name)); - if (IM == 0) + else + gethostname(host_name, sizeof(host_name)); + + if (IM == NULL) IM = strdup(""); + + if (IF != NULL) { + int tfd; + struct stat tst; + char *tbf; + + tfd = open(IF, O_RDONLY); + if (tfd == -1) { + IF = NULL; + } else { + fstat(tfd, &tst); + tbf = (char*)mmap(NULL, tst.st_size, PROT_READ, + 0, tfd, 0); + putf(tbf, ptyibuf2); + munmap(tbf, tst.st_size); + close(tfd); + IM = ""; + } + } + } else { IM = strdup(DEFAULT_IM); HE = 0; } edithost(HE, host_name); + if (hostinfo && *IM) putf(IM, ptyibuf2); --cut-- >Release-Note: >Audit-Trail: >Unformatted: