Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-26 Thread Tom Lane
Sam Mason writes: > Hum, why is PG doing an (unchecked) atoi on the user specified port > rather than leaving it up to getaddrinfo to resolve the port? It would > seem to require changing UNIXSOCK_PATH to accept a string as the "port > number", which is probably a bit much of a change. > The inc

Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-25 Thread Sam Mason
On Fri, Sep 25, 2009 at 09:29:24AM +0300, Peter Eisentraut wrote: > On Thu, 2009-09-24 at 20:36 -0400, Tom Lane wrote: > > BTW, are port numbers still limited to 16 bits in IPv6? > > Port numbers are in TCP, not in IP. I'd checked that it should work with IPv6, but I hadn't realized that it was b

Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-24 Thread Peter Eisentraut
On Thu, 2009-09-24 at 20:36 -0400, Tom Lane wrote: > BTW, are port numbers still limited to 16 bits in IPv6? Port numbers are in TCP, not in IP. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-g

Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-24 Thread Magnus Hagander
On 25 sep 2009, at 02.59, Tom Lane wrote: Sam Mason writes: +if (portnum < 1 || portnum > 65535) BTW, it strikes me that we could tighten this even more by rejecting target ports below 1024. This is guaranteed safe on all Unix systems I know of, because privileged ports can only b

Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-24 Thread Robert Haas
On Thu, Sep 24, 2009 at 8:59 PM, Tom Lane wrote: > Sam Mason writes: >> +             if (portnum < 1 || portnum > 65535) > > BTW, it strikes me that we could tighten this even more by rejecting > target ports below 1024.  This is guaranteed safe on all Unix systems > I know of, because privilege

Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-24 Thread Kris Jurka
On Thu, 24 Sep 2009, Tom Lane wrote: Sam Mason writes: + if (portnum < 1 || portnum > 65535) BTW, it strikes me that we could tighten this even more by rejecting target ports below 1024. Restricting the target port seems like a bad idea. What about a firewall (or ssh tunn

Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-24 Thread KaiGai Kohei
Tom Lane wrote: > Sam Mason writes: >> +if (portnum < 1 || portnum > 65535) > > BTW, it strikes me that we could tighten this even more by rejecting > target ports below 1024. This is guaranteed safe on all Unix systems > I know of, because privileged ports can only be listened to by

Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-24 Thread Tom Lane
Sam Mason writes: > + if (portnum < 1 || portnum > 65535) BTW, it strikes me that we could tighten this even more by rejecting target ports below 1024. This is guaranteed safe on all Unix systems I know of, because privileged ports can only be listened to by root-owned processes and

Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-24 Thread Robert Haas
On Thu, Sep 24, 2009 at 8:36 PM, Tom Lane wrote: > BTW, are port numbers still limited to 16 bits in IPv6? Yes. ...Robert -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] [HACKERS] libpq port number handling

2009-09-24 Thread Tom Lane
Sam Mason writes: > Hum, why is PG doing an (unchecked) atoi on the user specified port > rather than leaving it up to getaddrinfo to resolve the port? It would > seem to require changing UNIXSOCK_PATH to accept a string as the "port > number", which is probably a bit much of a change. > The incl