From owner-freebsd-bugs Thu Mar 13 4:50:20 2003 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 0FED437B401 for ; Thu, 13 Mar 2003 04:50:18 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7EA0343FD7 for ; Thu, 13 Mar 2003 04:50:15 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h2DCoFNS014593 for ; Thu, 13 Mar 2003 04:50:15 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h2DCoFOq014592; Thu, 13 Mar 2003 04:50:15 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6AE8437B401 for ; Thu, 13 Mar 2003 04:44:38 -0800 (PST) Received: from atlas.informatik.rwth-aachen.de (atlas.Informatik.RWTH-Aachen.DE [137.226.194.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id E9A1F43FA3 for ; Thu, 13 Mar 2003 04:44:36 -0800 (PST) (envelope-from stolz@i2.informatik.rwth-aachen.de) Received: from menelaos.informatik.rwth-aachen.de (menelaos.Informatik.RWTH-Aachen.DE [137.226.194.73]) by atlas.informatik.rwth-aachen.de (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) with ESMTP id h2DCiaa32382 for ; Thu, 13 Mar 2003 13:44:36 +0100 Received: (from stolz@localhost) by menelaos.informatik.rwth-aachen.de (8.12.6/8.12.6/Submit) id h2DCktHb086268; Thu, 13 Mar 2003 13:46:55 +0100 (CET) (envelope-from stolz) Message-Id: <200303131246.h2DCktHb086268@menelaos.informatik.rwth-aachen.de> Date: Thu, 13 Mar 2003 13:46:55 +0100 (CET) From: Volker Stolz Reply-To: Volker Stolz To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/49983: [patch] Fix bug & improve telnet status ouput on unix domain sockets Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 49983 >Category: bin >Synopsis: [patch] Fix bug & improve telnet status ouput on unix domain sockets >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: Thu Mar 13 04:50:14 PST 2003 >Closed-Date: >Last-Modified: >Originator: Volker Stolz >Release: FreeBSD 4.7-STABLE i386 >Organization: Lehrstuhl für Informatik II >Environment: System: FreeBSD menelaos.informatik.rwth-aachen.de 4.7-STABLE FreeBSD 4.7-STABLE #2: Fri Feb 7 12:48:00 CET 2003 root@menelaos.informatik.rwth-aachen.de:/usr/src/sys/compile/MENELAOS i386 >Description: Telnet prints incorrect status output for unix domain socket and leaves command mode after the first command because the connection counter isn't increased correctly. menelaos [13:33:03]> telnet -u /tmp/hws Trying /tmp/hws... No connection. Escape character is '^]'. ^] telnet> status No connection. Escape character is '^]'. menelaos [13:41:27]> The attached patch correctly counts the connection and improves telnet status output: Trying /tmp/hws... Connected to /tmp/hws. Escape character is '^]'. ^] telnet> status Connected to /tmp/hws. Operating in obsolete linemode Local character echo Escape character is '^]'. (still connected) >How-To-Repeat: Cf. description, connect to unix domain socket, query connection status. >Fix: - set 'hostname' to unix domain socket path - increase connection counter --- telnet begins here --- diff -urN telnet.orig/commands.c telnet/commands.c --- telnet.orig/commands.c Sat Nov 30 06:35:13 2002 +++ telnet/commands.c Thu Mar 13 13:17:31 2003 @@ -2005,6 +2005,7 @@ hostp); goto fail; } + hostname = hostp; memset(&su, 0, sizeof su); su.sun_family = AF_UNIX; strncpy(su.sun_path, hostp, sizeof su.sun_path); @@ -2207,6 +2208,7 @@ freeaddrinfo(src_res0); cmdrc(hostp, hostname); af_unix: + connected++; if (autologin && user == NULL) { struct passwd *pw; --- telnet ends here --- >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message