From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 11 17:05:00 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7FCC516A4DD; Thu, 11 Mar 2004 17:05:00 -0800 (PST) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 608D643D1F; Thu, 11 Mar 2004 17:05:00 -0800 (PST) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:smmsp@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.10/8.12.3) with ESMTP id i2C13Caf016147; Thu, 11 Mar 2004 17:04:53 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.10/8.12.3/Submit) id i2C102Ou015246; Thu, 11 Mar 2004 17:00:02 -0800 Date: Thu, 11 Mar 2004 17:00:01 -0800 From: Brooks Davis To: hackers@freebsd.org Message-ID: <20040312010000.GA9949@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qMm9M+Fa2AknHoGS" Content-Disposition: inline User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: dwmalone@freebsd.org Subject: inetd needs "discard" service in /etc/services X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Mar 2004 01:05:00 -0000 --qMm9M+Fa2AknHoGS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable While updating my diskless setup, I was trying to determine the minimal set of entries required in /etc/services in addition to a NIS "+" line to get a system to boot cleanly. I discovered that inetd depends on the existence of the discard service. The dependency is due to the fact that getaddrinfo is used to generate sockaddr_in(6) struct's and it's not really up to the task when we know neither the hostname or the service name. For some reason, discard was picked when IPv6 support was added and it's remained ever sense. A better organization of the code could work around this problem one of several ways, but that's more work then I want to do at this time. There also appears to be a secondary bug, probably in getaddrinfo that means that even though we can look discard up in NIS when inetd is started, it isn't being resolved there by getaddrinfo. I would like to commit the following patch. It changes the port from discard to syslog and documents the dependency. I choose syslog because it really does need to be in /etc/services on most machines since it starts before NIS. I'll also file a PR against inetd in hopes that someone gets board enough to fix it some day. Any objections? -- Brooks Index: inetd.8 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/cvs/src/usr.sbin/inetd/inetd.8,v retrieving revision 1.78 diff -u -p -r1.78 inetd.8 --- inetd.8 29 Feb 2004 15:49:26 -0000 1.78 +++ inetd.8 12 Mar 2004 00:55:54 -0000 @@ -919,3 +919,13 @@ The .Fx TCP Wrappers support first appeared in .Fx 3.2 . +.Sh BUGS +The +.Nm +utility requires that the +.Qq syslog +service be defined in +.Pa /etc/inetd.conf +unless the +.Fl a +argument is given. Index: inetd.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/cvs/src/usr.sbin/inetd/inetd.c,v retrieving revision 1.123 diff -u -p -r1.123 inetd.c --- inetd.c 30 Oct 2003 22:56:44 -0000 1.123 +++ inetd.c 12 Mar 2004 00:51:19 -0000 @@ -404,7 +404,7 @@ main(int argc, char **argv) * hostname or servname is non NULL. * So when hostname is NULL, set dummy value to servname. */ - servname =3D (hostname =3D=3D NULL) ? "discard" /* dummy */ : NULL; + servname =3D (hostname =3D=3D NULL) ? "syslog" /* dummy */ : NULL; =20 bzero(&hints, sizeof(struct addrinfo)); hints.ai_flags =3D AI_PASSIVE; --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --qMm9M+Fa2AknHoGS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFAUQuPXY6L6fI4GtQRAmckAJ43Pe3d2+f0hAlNeSno0zlWbXsvpACg4WTP Nw8FArH5YVVxhYomZ0WYO2E= =Qalp -----END PGP SIGNATURE----- --qMm9M+Fa2AknHoGS--