Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7TQ9-0007dj-0G for pgsql-bugs@arkaria.postgresql.org; Wed, 25 Oct 2017 21:41:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e7TQ8-0006JE-EL for pgsql-bugs@arkaria.postgresql.org; Wed, 25 Oct 2017 21:41:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e7TPP-000511-M0 for pgsql-bugs@postgresql.org; Wed, 25 Oct 2017 21:40:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e7TPM-00035F-Px for pgsql-bugs@postgresql.org; Wed, 25 Oct 2017 21:40:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v9PLeEfq026004; Wed, 25 Oct 2017 17:40:14 -0400 From: Tom Lane To: dcwatson@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14872: libpq requires a home directory In-reply-to: <20171025200457.1471.34504@wrigleys.postgresql.org> References: <20171025200457.1471.34504@wrigleys.postgresql.org> Comments: In-reply-to dcwatson@gmail.com message dated "Wed, 25 Oct 2017 20:04:57 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26002.1508967614.1@sss.pgh.pa.us> Date: Wed, 25 Oct 2017 17:40:14 -0400 Message-ID: <26003.1508967614@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org dcwatson@gmail.com writes: > It seems a side effect of allowing a pgpass file to be specified in libpq > connections[1] is that libpq errors out if a home directory cannot be found. > I'm building docker images for OpenShift which run as unnamed users without > a home directory, and since upgrading to the latest psycopg2 (which is built > against libpq 10), I get an error saying "Could not get home directory to > locate password file". Sigh. We keep breaking that use-case... which is unsurprising because nobody tests it. According to previous go-rounds, eg commits 5b4067798 and bd58d9d88, we should just silently do nothing if we can't get the home directory. Poking around, it looks like parseServiceInfo's search for ~/.pg_service.conf has the same disease, but that code's been like that since 2010 --- I wonder why it's not causing you problems? Are you maybe setting PGSERVICEFILE to prevent that from failing? regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs