In message <199908030624.haa00...@keep.lan.awfulhak.org> Brian Somers writes: : Exactly - ditto for gethostbyname(). In the case of gethostbyname(), : I believe that domain names can't have a number as the first : character - I would have thought this idea should follow through with : services.
No. That is in error. 3com.com or 2112.com. See RFC 1123 for the loosening of the restriction. You have to parse the whole string to know if it is a valid IP address or not anyway. : 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. But inetd isn't involved here at all. You do bring up a good point here in argument by analogy. However your rule for isdigit(arg[0]) breaks the following services: 3com-tsmux 106/tcp 3com-tsmux 106/udp 914c/g 211/tcp #Texas Instruments 914C/G Terminal 914c/g 211/udp #Texas Instruments 914C/G Terminal 9pfs 564/tcp #plan 9 file service 9pfs 564/udp #plan 9 file service 3l-l1 1511/tcp 3l-l1 1511/udp 3ds-lm 1538/tcp 3ds-lm 1538/udp 3m-image-lm 1550/tcp #Image Storage license manager 3M Company 3m-image-lm 1550/udp #Image Storage license manager 3M Company at least we know there are no all numeric service names in the standard /etc/services file. Warner To Unsubscribe: send mail to majord...@freebsd.org with "unsubscribe freebsd-hackers" in the body of the message