tag 259490 unreproducible
thanks

Hi Robert!

Robert McQueen [2004-07-15  3:15 +0100]:
> I've just spent a while debugging a really odd problem with postfix
> (2.1.3-1), which I now think is due to ungraceful handling of failing
> getpwuid calls in libpq3. Postfix's smtp server defaults to running in
> a chroot, and in my case is configured to look up aliases in a table
> held in postgres, connecting by TCP to localhost, using user/pass
> authentication.
> 
> However, when configured to do the lookup from within the chroot (rather
> than contacting a proxy daemon) the smtpd segfaults when it attempts to
> connect to the postgres server. I believe that this is because inside
> the chroot, postfix has no /etc/passwd file, and that in fe-auth.c,
> the fe_getauthname function calls pqGetpwuid with the current euid,
> which obviously fails.

I tried to reproduce this: I changed into a chroot, compiled a small
libpq test program that just connects and prints out the result of a
query. With an existing user id 1000 I called

  $ PGUSER=martin PGHOST=localhost PGPORT=5432 PGPASSWORD=foobar ./a.out

to contact the postgresql server in my normal system (outside the
chroot) over TCP passwd authentication (just as you describe). This
worked fine.

Then I moved away /etc/passwd and /etc/group, to invalidate the user
ID (id just prints numbers afterwards), which should trigger the case
you mentioned, but it still works perfectly. This worked also with
other user ids (daemon, etc.).

However, I used the Sarge version of libpq (7.4.7), which is a bit
newer than the one you used for filing the bug. Can you please check
whether the segfault still occurs?

Thanks,

Martin

-- 
Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org

Attachment: signature.asc
Description: Digital signature

Reply via email to