From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christoph Moench-Tegeder <cmt@burggraben.net>
Cc: Anders Kaseorg <andersk@mit.edu>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: alvherre@alvh.no-ip.org
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: [PATCH] Prefer getenv("HOME") to find the UNIX home directory
Date: Sun, 09 Jan 2022 17:40:08 -0500
Message-ID: <1888214.1641768008@sss.pgh.pa.us> (raw)
In-Reply-To: <YdtY6Xd1tkDEuV+7@elch.exwg.net>
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>
<d452fd57-8c34-0a94-79c1-4498eb4ffbdc@mit.edu>
<1769427.1641754742@sss.pgh.pa.us>
<YdtY6Xd1tkDEuV+7@elch.exwg.net>
Christoph Moench-Tegeder <cmt@burggraben.net> 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 <pwd.h>.
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, cmt@burggraben.net, andersk@mit.edu, daniel@yesql.se, horikyota.ntt@gmail.com, 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: <1888214.1641768008@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox