Re: Expand the use of check_canonical_path() for more GUCs

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Expand the use of check_canonical_path() for more GUCs
Date: 2020-06-04 05:19:01
Message-ID: 20200604051901.GR89559@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 03, 2020 at 02:45:50PM -0400, Tom Lane wrote:
> In the abstract, I agree with Peter's point that we shouldn't alter
> user-given strings without need. However, I think there's strong
> reason for canonicalizing the data directory and config file locations.
> We access those both before and after chdir'ing into the datadir, so
> we'd better have absolute paths to them --- and at least for the
> datadir, it's documented that you can initially give it as a path
> relative to wherever you started the postmaster from. If the other
> files are only accessed after the chdir happens then we could likely
> do without canonicalizing them. But ... do we know which directory
> the user (thought he) specified them with reference to? Forced
> canonicalization does have the advantage that it's clear to all
> onlookers how we are interpreting the paths.

Even with the last point... It looks like there is little love for
this patch. So it seems to me that this brings the discussion down to
two points: shouldn't we document why canonicalization is not done for
data_directory, config_file, hba_file and ident_file with some
comments in guc.c? Then, why do we apply it to external_pid_file,
Log_directory and stats_temp_directory knowing that we chdir to PGDATA
in the postmaster before they get used (as far as I can see)?
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2020-06-04 06:00:15 Re: Asynchronous Append on postgres_fdw nodes.
Previous Message Amit Kapila 2020-06-04 04:51:58 Re: Parallel copy