From: Christoph Moench-Tegeder <cmt@burggraben.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
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: Mon, 10 Jan 2022 00:11:59 +0100
Message-ID: <Ydtrv7YnD+ac+eQV@elch.exwg.net> (raw)
In-Reply-To: <1888214.1641768008@sss.pgh.pa.us>
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>
<1888214.1641768008@sss.pgh.pa.us>
## 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 <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?
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
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: cmt@burggraben.net, tgl@sss.pgh.pa.us, 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: <Ydtrv7YnD+ac+eQV@elch.exwg.net>
* 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