libpq 9.4 requires /etc/passwd?

Поиск
Список
Период
Сортировка
От Christoph Berg
Тема libpq 9.4 requires /etc/passwd?
Дата
Msg-id 20150109233240.GA30515@msg.df7cb.de
обсуждение исходный текст
Ответы Re: libpq 9.4 requires /etc/passwd?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

I've got several reports that postfix's pgsql lookup tables are broken
with 9.4's libpq5, while 9.3's libpq5 works just fine. The error
message looks like this:

Jan 10 00:11:40 lehmann postfix/trivial-rewrite[29960]: warning: connect to pgsql server localhost:5432: out of
memory?
Jan 10 00:11:40 lehmann postfix/trivial-rewrite[29960]: warning: pgsql:/etc/postfix/pgsqltest lookup error for "*"

The "out of memory?" message comes from PQsetdbLogin and
PQerrorMessage in postfix-2.11.3/src/global/dict_pgsql.c:
   if ((host->db = PQsetdbLogin(host->name, host->port, NULL, NULL,                                dbname, username,
password))== NULL       || PQstatus(host->db) != CONNECTION_OK) {       msg_warn("connect to pgsql server %s: %s",
         host->hostname, PQerrorMessage(host->db));
 

There are two ways around the problem on the postfix side: not running
the postfix service chrooted, or using a "proxy" map which effectively
does the lookup also from outside the chroot.

Debian bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756627
mentions another solution: creation of an /etc/passwd file inside the
postfix chroot.

libpq wants the user home directory to find .pgpass and
.pg_service.conf files, but apparently the behavior to require the
existence of the passwd file (or nss equivalent) is new in 9.4.

I've tried to make sense of the fe-connect.c code to find the issue
but couldn't spot it. Can someone explain what's going on there? Is
this a bug in libpq? (It's certainly a regression.)

Christoph
-- 
cb@df7cb.de | http://www.df7cb.de/



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: libpq 9.4 requires /etc/passwd?