From owner-freebsd-bugs Wed Jan 24 7:30:19 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 5111E37B402 for ; Wed, 24 Jan 2001 07:30:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f0OFU1q46704; Wed, 24 Jan 2001 07:30:01 -0800 (PST) (envelope-from gnats) Received: from goliath.siemens.de (goliath.siemens.de [194.138.37.131]) by hub.freebsd.org (Postfix) with ESMTP id 48EDE37B401 for ; Wed, 24 Jan 2001 07:20:19 -0800 (PST) Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by goliath.siemens.de (8.11.0/8.11.0) with ESMTP id f0OFKHC21903 for ; Wed, 24 Jan 2001 16:20:18 +0100 (MET) Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.42.7]) by mail1.siemens.de (8.11.0/8.11.0) with ESMTP id f0OFKHG29410 for ; Wed, 24 Jan 2001 16:20:17 +0100 (MET) Received: (from localhost) by curry.mchp.siemens.de (8.11.1/8.11.1) id f0OFKH657787 for FreeBSD-gnats-submit@freebsd.org; Wed, 24 Jan 2001 16:20:17 +0100 (CET) Message-Id: <200101241520.f0OFKH826314@curry.mchp.siemens.de> Date: Wed, 24 Jan 2001 16:20:17 +0100 (CET) From: Andre Albsmeier To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/24610: [PATCH] make inetd log hostnames when specifying -l twice Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 24610 >Category: bin >Synopsis: [PATCH] make inetd log hostnames when specifying -l twice >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Jan 24 07:30:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Andre Albsmeier >Release: FreeBSD 4.2-STABLE i386 >Organization: >Environment: All FreeBSD versions. >Description: When specifying -l inetd logs the IP address of succesful connections. With this patch, the hostname is logged instead of the IP address when -l is specified twice. >How-To-Repeat: run inetd -l and watch /var/log/messages while connecting to an inetd service. >Fix: The patch implements the above suggestion in inetd.c and documents it in inetd.8. The fact that a (possibly time consuming) DNS lookup can be needed has been documented as well. --- usr.sbin/inetd/inetd.c.ORI Wed Jan 24 11:32:17 2001 +++ usr.sbin/inetd/inetd.c Wed Jan 24 15:49:24 2001 @@ -310,7 +310,7 @@ options |= SO_DEBUG; break; case 'l': - log = 1; + log++; break; case 'R': getvalue(optarg, &toomany, @@ -566,7 +566,7 @@ peer.sa_len, pname, sizeof(pname), NULL, 0, - NI_NUMERICHOST| + (log > 1 ? 0 : NI_NUMERICHOST) | NI_WITHSCOPEID); pnm = pname; } @@ -575,7 +575,7 @@ peer.sa_len, pname, sizeof(pname), NULL, 0, - NI_NUMERICHOST| + (log > 1 ? 0 : NI_NUMERICHOST) | NI_WITHSCOPEID); pnm = pname; } --- usr.sbin/inetd/inetd.8.ORI Wed Jan 24 15:49:53 2001 +++ usr.sbin/inetd/inetd.8 Wed Jan 24 15:54:29 2001 @@ -79,7 +79,9 @@ .It Fl d Turn on debugging. .It Fl l -Turn on logging of successful connections. +Turn on logging of successful connections. If specified twice, +the address is converted into a name which could result in a +(possibly time consuming) DNS lookup. .It Fl w Turn on TCP Wrapping for external services. See the >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message