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 1n6hMA-0001n2-HG for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Jan 2022 23:12:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n6hM7-00043i-Hs for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Jan 2022 23:12:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n6hM7-00043Z-4c for pgsql-hackers@lists.postgresql.org; Sun, 09 Jan 2022 23:12:07 +0000 Received: from smtp.burggraben.net ([88.198.69.140]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n6hM2-0006bm-Gs for pgsql-hackers@lists.postgresql.org; Sun, 09 Jan 2022 23:12:05 +0000 Received: from elch.exwg.net (elch.exwg.net [IPv6:2001:470:7120:1:127b:44ff:fe4f:148d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "elch.exwg.net", Issuer "R3" (not verified)) by smtp.burggraben.net (Postfix) with ESMTPS id EEFE4C00316; Mon, 10 Jan 2022 00:11:59 +0100 (CET) Received: by elch.exwg.net (Postfix, from userid 1000) id 94BC53AB02; Mon, 10 Jan 2022 00:11:59 +0100 (CET) Date: Mon, 10 Jan 2022 00:11:59 +0100 From: Christoph Moench-Tegeder To: Tom Lane 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 Message-ID: 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> <1888214.1641768008@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1888214.1641768008@sss.pgh.pa.us> User-Agent: Mutt/2.1.5 (2021-12-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ## Tom Lane (tgl@sss.pgh.pa.us): > 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? After poking around across some Linuxes, it looks like people silently agreed that "services" are not logged-in users: among the daemons, having HOME set (as observed in /proc/*/environ) is an exception, not the norm. I'm not sure if that's a "new" thing with systemd, I don't have a linux with pure SysV-init available (but I guess those are rare animals anyways). Regards, Christoph -- Spare Space