Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nERqi-0002kk-GH for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Jan 2022 08:15:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nERqh-0001kG-Dr for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Jan 2022 08:15:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nERqg-0001k4-Hs for pgsql-hackers@lists.postgresql.org; Mon, 31 Jan 2022 08:15:43 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nERqd-0002z3-TM for pgsql-hackers@lists.postgresql.org; Mon, 31 Jan 2022 08:15:41 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 0A1E15C010E; Mon, 31 Jan 2022 03:15:38 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 31 Jan 2022 03:15:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; bh=9awXvj/gx2gsdwCcN6OevvFw5939CNGP6TmGHT Ml8CU=; b=a34NgdmkQb0ko6GZVR8rb1acoqlRZvYu63QIjZlpvm/TfBZUna+0a3 dJWQ7u8XEJfGBCuoqCNNrZi+aoMdN0vESf/fjhImFjf8MH8DInkc3i8r5o50qZnQ Y8QzzaKSzcTfJjgxjX0kmlAFgwj3hQ8A0YMkPsYz27v8xaSidK2BbeSwKKMPeqnh ItzF2oRj87KKhz8BH35Vvgk0bPcKWza6IMRVYsrzk/AZ1TxDpgvg9pC3RLP78MgZ /d/wRkkjs/fVJGDhCa3zMIK4PVNaU5YhU6UEUGr0PQbiFhk/F8KpreWzVlD3X5Do GXJoZc0u/AmrUgAj2UScNAJbxL0cZaHw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=9awXvj/gx2gsdwCcN 6OevvFw5939CNGP6TmGHTMl8CU=; b=dskiLPPCO/m39nhkk58sbtPKY1xUyD9Aq 7sXheIclTSrr9GeS2OgB+5fDv7nrORju3Y80hw0srC/rrFGgjIgCbku2DQbh3Cz8 FW//xdQ3OSOi5IVMcBwmJnvB4DAGplFQcVfBNMKJ66fwL2xfKYGsvEcyOi73FhbR bYJA72rE9K3lh9s5VnY1GPX+Sys/CMQ+IEgQRVbzjZ/vPDuF7lgZp4dXOzkRhHnw DDApiA+AGEgAnpyeyvFmG9zgAe5U9kl/bcwOOL/mByjmvSBxxzjperMxmclxEMvp +if9jKpizlLfGoyimFYKP/iiTr8ol1JK3DEMJKw5e/8AzUjTGTqYw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrgedtgdduudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhu ihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrh hnpedvgeduuefhtdeuleettdevjeehheeiveeuieegleetgeeljeelieeuieehgeevhfen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthh grvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 31 Jan 2022 03:15:35 -0500 (EST) Date: Mon, 31 Jan 2022 17:15:33 +0900 From: Michael Paquier To: Tom Lane Cc: "wangsh.fnst@fujitsu.com" , Julien Rouhaud , Kyotaro Horiguchi , "andrew@dunslane.net" , "pgsql-hackers@lists.postgresql.org" Subject: Re: drop tablespace failed when location contains .. on win32 Message-ID: References: <20210913.173629.689388354506122738.horikyota.ntt@gmail.com> <1479474.1636584211@sss.pgh.pa.us> <20220117004038.fcywmknzj45kiulz@jrouhaud> <462031.1643579403@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="aUdWZ4vGHJUTiH0I" Content-Disposition: inline In-Reply-To: <462031.1643579403@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --aUdWZ4vGHJUTiH0I Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Jan 30, 2022 at 04:50:03PM -0500, Tom Lane wrote: > Here's a revised patch version that does it like that. I also > reviewed and simplified the canonicalize_path logic. I think > this is committable. Thanks for the updated version. The range of the tests looks fine enough, and the CF bot does not complain. The code is straight-forward and pretty clear in terms of the handling of ".", ".." and the N-depth handling necessary. Should we have tests for WIN32 (aka for driver letters and "//")? This could be split into its own separate test file to limit the damage with the alternate outputs, and the original complain was from there. > (I suspect that adminpack's checks for unsafe file names could > now be simplified substantially, because many of the corner cases > it worries about are no longer possible, as evidenced by the change > in error message there. I've not pursued that, however.) Fine by me to let this part for later. -- Michael --aUdWZ4vGHJUTiH0I Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmH3mqUACgkQnvQgOdby QH240w/7BgdtAyVChHnLiPew+TLxQlN91ZxbFk+u/wvAc4Nr2yNgRQXQ7iaawr8f 1blAsJY+uY9hD1toblvzdZy74GZlsRd1J5HTHxWqyr/huQQmwsO7i1kTalG8YTR3 OSy7K++UcRBqDMKHVIUEbdP+6SI6lLkG5lf80NiAxjLTONcyDuwsFMfiJhAsA6b0 /90LQv+NgtQutMP5ZWQfnB+ABsPzBUnqxAw2WNMFps9i/QGr6vOkJ36+AZA28eBw PoRVBJgs6iZ4DKggIqKEARSdf/BBmFNW0O9RsMYA+I6P1eWLVVG8n8bu8NcQEmTh pvmwgDdiALH722iBVHjXFcRhUucfnhULGPPQK3QtC3hZERqCIPpojmWBvyGiTuR3 riEeZkciRt9eT0w0QsnrzBr0JFTjGK01hrK0yp62md1tpr7UDAF0WM88NBL/GE23 prhw6vC6PjSU0PI4biyttF6mzHIT9qfhYW+pMtA85q3VBGjxmwBmJ70btd6OWu52 HowJb1bwPVvlUBgbZdzhqla5EQROH7HP0xAmnRbCVJZFNDdIenOkBS68gHwNkWO5 gtHNXcg78XGeVRgIvsV2zN8tU7x5cp5F2JhJ4/Xkrdqoc+KR2nfgRaIN9BmZnP1+ J7LzlBQqgo/DwplFECqQ5mt83yAF27muTuUqwlQonuHDIXfdwvg= =gZBv -----END PGP SIGNATURE----- --aUdWZ4vGHJUTiH0I--