Prevent pg_basebackup running as root - Mailing list pgsql-hackers

From Ian Barwick
Subject Prevent pg_basebackup running as root
Date
Msg-id CABvVfJVqOdD2neLkYdygdOHvbWz_5K_iWiqY+psMfA=FeAa3qQ@mail.gmail.com
Whole thread Raw
Responses Re: Prevent pg_basebackup running as root  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Hi

We encountered an unfortunate case of $SUBJECT the other day where it
would have been preferable to catch the error before rather than after pg_basebackup ran.

I can't think of any practical reason why pg_basebackup would ever need to
be run as root; we disallow that for initdb, pg_ctl and pg_upgrade, so it
seems reasonable to do the same for pg_basebackup. Trivial patch attached,
which as with the other cases will allow only the --help/--version options
to be executed as root, otherwise nothing else.

The patch doesn't update the pg_basebackup documentation page; we don't
mention it in the pg_ctl and pg_upgrade pages either and it doesn't seem
particularly important to mention it explicitly.

I'll add this to the March CF.


Regards

Ian Barwick


--
  Ian Barwick                   https://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services
Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BufFileRead() error signalling
Next
From: Michael Paquier
Date:
Subject: Re: Prevent pg_basebackup running as root