Re: netcat(1): check local port val

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ingo Schwarze
Date: Sunday, September 26, 2010 - 3:07 pm

Hi Mark,

Mark Lumsden wrote on Thu, Sep 23, 2010 at 07:38:00AM +0000:

[...]

No, not ok; i think the patch is incorrect.

The pflag is passed to getaddrinfo(3):

     int
     getaddrinfo(const char *hostname, const char *servname, const struct
     addrinfo *hints, struct addrinfo **res);

     The servname is either a decimal port number or a service name
     listed in services(5).

Thus, no input validation is desirable.
In fact, nc(1) already provides a (well, moderately) useful error
message when you provide a service not listed in services(5):

  schwarze@rhea $ nc -p murks localhost 30000
  nc: getaddrinfo: service not supported for ai_socktype

Yours,
  Ingo


Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
netcat(1): check local port val, Mark Lumsden, (Thu Sep 23, 12:38 am)
Re: netcat(1): check local port val, Ingo Schwarze, (Sun Sep 26, 3:07 pm)
Re: netcat(1): check local port val, Mark Lumsden, (Mon Sep 27, 2:39 am)