Re: PostgreSQL 8.0.3, AIX 5.1, getaddrinfo, AI_NUMERICHOST - Mailing list pgsql-ports

From Logan O'Sullivan Bruns
Subject Re: PostgreSQL 8.0.3, AIX 5.1, getaddrinfo, AI_NUMERICHOST
Date
Msg-id 20050808200937.GV6200@pravda.gedanken.org
Whole thread Raw
In response to Re: PostgreSQL 8.0.3, AIX 5.1, getaddrinfo, AI_NUMERICHOST  ("Mohan, Ross" <RMohan@arbinet.com>)
Responses Re: PostgreSQL 8.0.3, AIX 5.1, getaddrinfo, AI_NUMERICHOST  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-ports
I only have access to AIX5.1. On 5.1 the relevant prototype and
defines are in netdb.h.

The man page for has:

struct addrinfo {

  int               ai_flags;          /* AI_PASSIVE, AI_CANONNAME */

Note the absence of AI_NUMERICHOST. It isn't mentioned anywhere in the
man page but it is present in the header. Perhaps it wasn't a complete
implementation for 5.1 but they fixed it by 5.3?

  - logan

On Mon, Aug 08, 2005 at 06:30:01PM -0000, Mohan, Ross wrote:
> Apparently something amiss.
>
> even on AIX5.3, the getaddrinfo.h is ONLY present courtesy of PG distro.
>
>
> I found that odd.
>
>
> But: it's there, and it does the right thing (ver8.0.2)
>
>
> -----Original Message-----
> From: pgsql-ports-owner@postgresql.org [mailto:pgsql-ports-owner@postgresql.org] On Behalf Of Mohan, Ross
> Sent: Monday, August 08, 2005 10:20 AM
> To: pgsql-ports@postgresql.org
> Subject: Re: [PORTS] PostgreSQL 8.0.3, AIX 5.1, getaddrinfo, AI_NUMERICHOST
>
>
> Wow, nice catch, nice analysis. Checking now whether my AIX5.2/3 boxes set this correctly.
>
>
> -----Original Message-----
> From: pgsql-ports-owner@postgresql.org [mailto:pgsql-ports-owner@postgresql.org] On Behalf Of Logan O'Sullivan Bruns
> Sent: Wednesday, August 03, 2005 8:04 PM
> To: pgsql-ports@postgresql.org
> Subject: [PORTS] PostgreSQL 8.0.3, AIX 5.1, getaddrinfo, AI_NUMERICHOST
>
>
> Hello everyone,
>
> I ran into a minor bug with PostgreSQL 8.0.3 compiled with xlc on AIX 5.1 (5100-04). Basically it worked fine
connectingvia unix domain sockets but when you connected to it using TCP/IP with JDBC the child process would SEGV. I
trackedthe problem to a call to getaddrinfo while evaluating the host based access control rules. 
>
> The code in function parse_hba on line 752 of hba.c sets the ai_flags member of the addrinfo struct to
AI_NUMERICHOST.This is eventually passed into a call to getaddrinfo that results in the SEGV. The manual page from the
boximplies that at least this version of AIX does not the AI_NUMERICHOST flag. (As opposed to, say, Solaris which
clearly
> does.)
>
> Ifdefing the code so that ai_flags is set to zero on AIX fixes the problem.
>
> Anyway, I hope this is helpful to someone or the right place to send such notes. Please let me know if you need any
additionalinformation. 
>
> Thanks,
>   logan
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq

pgsql-ports by date:

Previous
From: "Mohan, Ross"
Date:
Subject: Re: PostgreSQL 8.0.3, AIX 5.1, getaddrinfo, AI_NUMERICHOST
Next
From: Tom Lane
Date:
Subject: Re: PostgreSQL 8.0.3, AIX 5.1, getaddrinfo, AI_NUMERICHOST