Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id ACD981337B3E for ; Thu, 3 Mar 2011 16:30:26 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 84326-09 for ; Thu, 3 Mar 2011 20:30:16 +0000 (UTC) X-Greylist: delayed 00:42:29.281145 by SQLgrey-1.7.6 Received: from mail.kvr.at (kvr.at [83.65.151.178]) by mail.postgresql.org (Postfix) with ESMTP id C4821133655C for ; Thu, 3 Mar 2011 16:30:15 -0400 (AST) Received: from 83-65-151-182.work.xdsl-line.inode.at ([83.65.151.182]:45653 helo=[10.7.77.20]) by mail.kvr.at with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1PvEUw-0007Ye-6u for pgsql-bugs@postgresql.org; Thu, 03 Mar 2011 20:47:42 +0100 Message-ID: <4D6FF05E.1050201@kvr.at> Date: Thu, 03 Mar 2011 20:47:42 +0100 From: Christian Kastner User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101226 Iceowl/1.0b1 Icedove/3.0.11 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: Possible regression: libpq + SSL aborts when user has no home directory X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/77 X-Sequence-Number: 29587 Using libpq 9.0.3, when an SSL connection is attempted from a client whose EUID is not in a password database, the connection fails because the home directory cannot be determined. With libpq 8.4.7, everything is fine. I encountered this issue on my mail host, where I use virtual users. When mail is delivered, parameters such as UID, home directory, etc. are retrieved using multiple queries against a Postgres DB. As soon as the virtual user's UID (which does not exist in any local password database) is determined, exim setuid()s to it. All further queries then fail with an error similar to this one: PGSQL connection failed: could not get home directory to locate client certificate files FATAL: no pg_hba.conf entry for host "1.2.3.4", user "exim4", database "fake_name", SSL off Looking at interfaces/libpq/fe-secure.c, it seems that such a failure previously only occurred when sslmode was "verify-*", otherwise the missing home dir was ignored. Now, it always fails. It was pointed out to me that the client-side SSL stuff changed in 9.0.3, so this might be entirely valid. I was just a little suprising. Regards, Christian