Re: Fix pg_rewind which can be run as root user

2018-04-09 Thread Michael Paquier
On Mon, Apr 09, 2018 at 09:36:40PM +0200, Magnus Hagander wrote: > Applied, and pushed this way. OK, thanks for the commit. -- Michael signature.asc Description: PGP signature

Re: Fix pg_rewind which can be run as root user

2018-04-09 Thread Magnus Hagander
On Mon, Apr 9, 2018 at 9:31 PM, Tom Lane wrote: > Magnus Hagander writes: > > Seems simple enough and the right hting to do, but I wonder if we should > > really backpatch it. Yes, the behaviour is not great now, but there is > also > > a non-zero risk

Re: Fix pg_rewind which can be run as root user

2018-04-09 Thread Tom Lane
Magnus Hagander writes: > Seems simple enough and the right hting to do, but I wonder if we should > really backpatch it. Yes, the behaviour is not great now, but there is also > a non-zero risk of breaking peoples automated failover scripts of we > backpatch it, isn't it?

Re: Fix pg_rewind which can be run as root user

2018-04-09 Thread Peter Geoghegan
On Mon, Apr 9, 2018 at 12:23 PM, Magnus Hagander wrote: > Seems simple enough and the right hting to do, but I wonder if we should > really backpatch it. Yes, the behaviour is not great now, but there is also > a non-zero risk of breaking peoples automated failover scripts of

Re: Fix pg_rewind which can be run as root user

2018-04-09 Thread Magnus Hagander
On Mon, Apr 9, 2018 at 7:11 AM, Michael Paquier wrote: > Hi all, > > I was just going through pg_rewind's code, and noticed the following > pearl: > /* > * Don't allow pg_rewind to be run as root, to avoid overwriting the > * ownership of files in the data

Fix pg_rewind which can be run as root user

2018-04-08 Thread Michael Paquier
Hi all, I was just going through pg_rewind's code, and noticed the following pearl: /* * Don't allow pg_rewind to be run as root, to avoid overwriting the * ownership of files in the data directory. We need only check for root * -- any other user won't have sufficient