Re: pgsql: Prevent running pg_basebackup as root

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Prevent running pg_basebackup as root
Date: 2020-02-06 07:04:17
Message-ID: 20200206070417.GJ23913@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Wed, Feb 05, 2020 at 12:22:59PM -0500, Stephen Frost wrote:
> In any case, sorry for not responding on this sooner (was traveling for
> FOSDEM and such), but I'm not really convinced this is something we want
> and it certainly breaks at least somewhat reasonable use-cases when you
> think about using pg_basebackup with -Ft. In that vein, this change is
> kinda like saying "you can't run pg_dump as root"..

It seems to me that this is entirely different than the case of
pg_dump, as it is possible to restore a dump even as root, something
that cannot happen with physical backups without an extra chmod -R.
You have a point with -Ft as untaring the tarballs from a base backup
taken with pg_basebackup -Ft used by root generates files owned by the
original user. -Fp enforces the files to be owned by the user taking
the backup, which makes the most sense, so for consistency with the
other tools preventing root to run pg_basebackup makes sense to me
with -Fp. Any thoughts from others to restrict the tool with -Fp but
not with -Ft? The argument of consistency mattered for me first for
both formats.
--
Michael

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2020-02-06 11:10:40 pgsql: Fix typo.
Previous Message Fujii Masao 2020-02-06 05:46:51 pgsql: Fix bug in LWLock statistics mechanism.

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2020-02-06 07:05:02 Re: In PG12, query with float calculations is slower than PG11
Previous Message Amit Kapila 2020-02-06 06:40:42 Re: typo in set_rel_consider_parallel()