Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n6grR-0000gV-AY for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Jan 2022 22:40:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n6grP-0002hR-Ad for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Jan 2022 22:40:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n6grP-0002cr-0i for pgsql-hackers@lists.postgresql.org; Sun, 09 Jan 2022 22:40:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n6grM-0000N7-Rh for pgsql-hackers@lists.postgresql.org; Sun, 09 Jan 2022 22:40:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 209Me8c91888215; Sun, 9 Jan 2022 17:40:08 -0500 From: Tom Lane To: Christoph Moench-Tegeder cc: Anders Kaseorg , Daniel Gustafsson , Kyotaro Horiguchi , alvherre@alvh.no-ip.org, pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] Prefer getenv("HOME") to find the UNIX home directory In-reply-to: References: <202110182223.zeze33l55qa5@alvherre.pgsql> <20211019.173422.706584612464055211.horikyota.ntt@gmail.com> <5d675cbe-7837-e9ae-961d-be7d03201f3b@mit.edu> <20211020.144014.580443822870543857.horikyota.ntt@gmail.com> <07CA67A0-A46C-4ED5-99C6-24D41BDDC8CA@yesql.se> <1769427.1641754742@sss.pgh.pa.us> Comments: In-reply-to Christoph Moench-Tegeder message dated "Sun, 09 Jan 2022 22:51:37 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1888213.1641768008.1@sss.pgh.pa.us> Date: Sun, 09 Jan 2022 17:40:08 -0500 Message-ID: <1888214.1641768008@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Christoph Moench-Tegeder writes: > ## Tom Lane (tgl@sss.pgh.pa.us): >> Given the POSIX requirements, it's basically impossible to believe >> that there are interesting cases where $HOME isn't set. > When I look at a random Debian with the usual PGDG packages, the > postmaster process (and every backend) has a rather minimal environment > without HOME. When I remember the code correctly, walreceiver uses > the functions from fe-connect.c and may need to find the service file, > a password file or certificates. If I'm correct with that, requiring > HOME to be set would be a significant change for existing "normal" > installations. > What about containers and similar "reduced" environments? Isn't that a flat out violation of POSIX 8.3 Other Environment Variables? HOME The system shall initialize this variable at the time of login to be a pathname of the user's home directory. See . To claim it's not, you have to claim these programs aren't logged in, in which case where did they get any privileges from? regards, tom lane