From owner-freebsd-bugs Tue Dec 3 7:10: 5 2002 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 2396937B401 for ; Tue, 3 Dec 2002 07:10:03 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A332243EC5 for ; Tue, 3 Dec 2002 07:10:01 -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 gB3FA1x3056455 for ; Tue, 3 Dec 2002 07:10:01 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gB3FA1rr056454; Tue, 3 Dec 2002 07:10:01 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 82B2437B404 for ; Tue, 3 Dec 2002 07:07:48 -0800 (PST) Received: from mailhub.fokus.gmd.de (mailhub.fokus.gmd.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D60A43E4A for ; Tue, 3 Dec 2002 07:07:47 -0800 (PST) (envelope-from brandt@fokus.gmd.de) Received: from beagle.fokus.gmd.de (beagle [193.175.132.100]) by mailhub.fokus.gmd.de (8.11.6/8.11.6) with ESMTP id gB3F7jn24688 for ; Tue, 3 Dec 2002 16:07:45 +0100 (MET) Received: from beagle.fokus.gmd.de (localhost [127.0.0.1]) by beagle.fokus.gmd.de (8.12.6/8.12.6) with ESMTP id gB3F7jeU002226 for ; Tue, 3 Dec 2002 16:07:45 +0100 (CET) (envelope-from hbb@beagle.fokus.gmd.de) Received: (from root@localhost) by beagle.fokus.gmd.de (8.12.6/8.12.6/Submit) id gB3F7j1X002225; Tue, 3 Dec 2002 16:07:45 +0100 (CET) (envelope-from hbb) Message-Id: <200212031507.gB3F7j1X002225@beagle.fokus.gmd.de> Date: Tue, 3 Dec 2002 16:07:45 +0100 (CET) From: Hartmut Brandt Reply-To: Hartmut Brandt To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/45967: telnetd does not set SO_DEBUG for -debug option 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: 45967 >Category: bin >Synopsis: telnetd does not set SO_DEBUG for -debug option >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Dec 03 07:10:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Hartmut Brandt >Release: FreeBSD 5.0-CURRENT i386 >Organization: Fraunhofer Fokus >Environment: System: FreeBSD beagle.fokus.gmd.de 5.0-CURRENT FreeBSD 5.0-CURRENT #4: Thu Oct 17 15:52:15 CEST 2002 hbb@beagle.fokus.gmd.de:/opt/obj/usr/src/sys/BEAGLE i386 >Description: man telnet describes that the -debug option to telnetd sets the SO_DEBUG option on the telnet socket. This is not actually the case. >How-To-Repeat: Compile a kernel with TCPDEBUG set. Invoke telnetd -debug. Establish a connection to the telnetd. Call trpt and observe, that there is no output (for the telnetd sockets). >Fix: Apply the following patch to the telnetd source. Index: telnetd.c =================================================================== RCS file: /usr/ncvs/src/libexec/telnetd/telnetd.c,v retrieving revision 1.33 diff -c -r1.33 telnetd.c *** telnetd.c 30 Nov 2001 22:37:28 -0000 1.33 --- telnetd.c 3 Dec 2002 15:03:17 -0000 *************** *** 287,292 **** --- 287,295 ---- err(1, "socket"); (void) setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on)); + (void) setsockopt(s, SOL_SOCKET, SO_DEBUG, + (char *)&on, sizeof(on)); + if (bind(s, res->ai_addr, res->ai_addrlen) < 0) err(1, "bind"); if (listen(s, 1) < 0) *************** *** 295,300 **** --- 298,305 ---- ns = accept(s, res->ai_addr, &foo); if (ns < 0) err(1, "accept"); + (void) setsockopt(ns, SOL_SOCKET, SO_DEBUG, + (char *)&on, sizeof(on)); (void) dup2(ns, 0); (void) close(ns); (void) close(s); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message