Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1izbDH-0004f0-H9 for pgsql-committers@arkaria.postgresql.org; Thu, 06 Feb 2020 07:04:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1izbDE-0006nu-BQ for pgsql-committers@arkaria.postgresql.org; Thu, 06 Feb 2020 07:04:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1izbDC-0006nn-An for pgsql-committers@lists.postgresql.org; Thu, 06 Feb 2020 07:04:32 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1izbD7-0001aZ-Ve for pgsql-committers@lists.postgresql.org; Thu, 06 Feb 2020 07:04:29 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 306441B1; Thu, 6 Feb 2020 02:04:22 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 06 Feb 2020 02:04:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=tDl1QewdQB/hDn6u3StN4Oznsr+ X0TqxGLxXpYU3dPY=; b=GgHoJbEU08vUc2Bv7QMHQUW6dbhFflNLBMCMewZnHqy PFT1uix9oggA/yY5K6TrzUdKCwhTRBYjl3bZrxrzwx0Z8AI4YChoQ/M5UvmAvQq2 eKK9hW6BdQJhjzq2fWQ2qyqHBQyC720njqSN6IGe58qR+F9yfRSyI/UCi/DBLieP p5ZfVRuBCkuc6zi99pF+3aegXEgeiU+SZamJrgnc9eP2Jp7pmJV8J6b2qb+YIlBa t3TOzdZxyLlRaKGAowOpb9kWM3u2pro/5NXv6Qj9kkpEwhDrVbUPQI1nTBkgoV1x 2yVjoMsSdWdbwQ3j2XMUaMvyuvfJjVPUO/LSqvkqXYw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=tDl1Qe wdQB/hDn6u3StN4Oznsr+X0TqxGLxXpYU3dPY=; b=RCT3yR/nS7/BQeRG5Gp/TP 9ED4LQXStQcF0+MrtAchNbIJ0yBSA354+6NWEL4anKFW8kYsjzVEtjAutcl8ZgrA VojYWf5AMZJ/yPPVBOFjDzol36c+S+Xad41p6jMsLTavWY0Hy4mo9nXv+MLe4s36 cWZwjQz7LA6plGhQ03bGDnwF5Iv6IQmNcqO9HVZSO+VBG+RVkb9ae5ZknA1DQkKL 5nHBGSmq4bIEf2bjtxsAEOie6Gg7A/x83lA4b/kuMQXhdBIqqfj1kNd0xveOjbQE ZF+9OcAXACKvVsPLqVCWpEW0oXHyxHoqBaeGpcVo/YdlIcPlCj/Uh259JX3bNLaw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrhedvgddutdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucfkphepudduuddruddtvddrudektddrudekheenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlse hprghquhhivghrrdighiii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 49E8430600DC; Thu, 6 Feb 2020 02:04:20 -0500 (EST) Date: Thu, 6 Feb 2020 16:04:17 +0900 From: Michael Paquier To: Stephen Frost Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Prevent running pg_basebackup as root Message-ID: <20200206070417.GJ23913@paquier.xyz> References: <20200205172259.GW3195@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HVCoas+krw6dou6l" Content-Disposition: inline In-Reply-To: <20200205172259.GW3195@tamriel.snowman.net> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --HVCoas+krw6dou6l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=20 not with -Ft? The argument of consistency mattered for me first for both formats. -- Michael --HVCoas+krw6dou6l Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl47unEACgkQnvQgOdby QH0mVBAAgT0mCas/DaIUW12z5KP6EiI//DNhMOmKMPpO/9ffzD1/zBc7na9VvEYq 1MNVhN4sOcn7tutbewen1f5ZxyqoWhsxouKulDOuzrQpnsbLy3lDLg6Psj+cOf4f uN6EQ6N/J5z6uF7Yj/xSE8lqONin8P59aCw3LCsHO7ITRji7DLp7OcS1du0DEhBQ wlbTI/fzCSaJi9AMBi9nM0/FyLjvXaY2LrV+vbABz2kQ/9QG1524HsR8PQKfgP+w WEYPN9nWaPCgna5R/6YR2MvySeBtT3SVEzVGSSBFSeLc6Is3kCQ0VGllN9M2jpD8 RxT1qmjkmr2qdWuUH4OgJXxH1ManNFesgKrPuhJyDSsogfBjwk1TeOI+J4f2z3EP MSwDdZEfIV2lFB2QYyElsRNIpGgAX8/s/v8l6IG2BBhnKFMvPAJn8KQ+CXbidr5m FpaInuIhCYjNe1MqyI0OXV03aoUDxkp3GiE38+3fLX7PqHQatxpi/BOnrNyav/L0 Gl28q05EI6hqp39fcKAR1N6wWnpVsCHbiwxjSB+EzM8Cc0sAWWt+J0LdPrTDeWkp AcUt91LvR3GLKyUeLPejtqVZL4pj4WO/5QZWLW6EjfLrpzX7GgtOgS93SWG8cIo7 zUy9BbJ4Jg86D8yibj+GRAc8AuEG1YKqy5FUlpzndT50Y1xBSyI= =la57 -----END PGP SIGNATURE----- --HVCoas+krw6dou6l--