From owner-freebsd-hackers Tue Aug 3 15: 8:58 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from alcanet.com.au (border.alcanet.com.au [203.62.196.10]) by hub.freebsd.org (Postfix) with ESMTP id 883C914DFF for ; Tue, 3 Aug 1999 15:08:42 -0700 (PDT) (envelope-from jeremyp@gsmx07.alcatel.com.au) Received: by border.alcanet.com.au id <40322>; Wed, 4 Aug 1999 07:47:10 +1000 Date: Wed, 4 Aug 1999 08:06:29 +1000 From: Peter Jeremy Subject: Re: Mentioning RFC numbers in /etc/services To: hackers@FreeBSD.ORG Message-Id: <99Aug4.074710est.40322@border.alcanet.com.au> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Assar Westerlund wrote: As an enhancement, the strtol() check should verify that the passed service number is completely numeric: >--- inetd.c.orig Mon Aug 2 22:35:28 1999 >+++ inetd.c Mon Aug 2 22:41:52 1999 >@@ -830,34 +830,50 @@ > continue; > } > if (!sep->se_rpc) { >+ int port; + char *ep; >+ > sp = getservbyname(sep->se_service, sep->se_proto); > if (sp == 0) { >- syslog(LOG_ERR, "%s/%s: unknown service", >+ port = htons(strtol (sep->se_service, + &ep, 0)); + if (port <= 0 || *ep) { ... and similarly for the RPC service number. Brian Somers wrote: >I know I'd be pretty annoyed if I tried to do something like ``ssh -p >1234 somewhere'' after configuring my interface in single-user modem >with nis in /etc/host.conf and found that ssh was looking up 1234 in >/etc/services. Even if this is right, it's not intuitive. Adding definitions like ': 1 2 ;' to forth is always good for confusing people. Similarly, adding lines like '1234 4321/tcp' to /etc/services will lead to counter-intuitive behaviour. That said, I think that the get...byname() should preceed the strtol() for general consistency. Brian Somers wrote: >I've been stung with things like pipe() for exactly the same reasons. >IMHO, pipe() should *not* behave like socketpair() as it encourages >FreeBSD developers to write bad code :-( SVR4 provides bi-directional pipe(2) FD's. Digital UNIX (aka OSF/1 aka Tru64) seems to support both behaviours. I suspect the trend will be for pipe()'s to be bi-directional. Feel free to add a sysctl to make pipe's unidirectional. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message