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 1mOAzn-0008BK-EB for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Sep 2021 03:45:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mOAzk-0007L5-Vj for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Sep 2021 03:45:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mOAzj-0007Kw-NA for pgsql-hackers@lists.postgresql.org; Thu, 09 Sep 2021 03:45:00 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mOAzf-00053s-Pw for pgsql-hackers@lists.postgresql.org; Thu, 09 Sep 2021 03:44:59 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B6E2C5C0043; Wed, 8 Sep 2021 23:44:52 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 08 Sep 2021 23:44:52 -0400 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=fm2; bh=z3wpOM3wEenkSR66nQ40DCjllIN 91iuyW7X5dn7OvyU=; b=UekHfwPusr6w5rlTqCcMardEuxeKejOdizeIvKRzupu ySahFf2owmqnbMymiQibwZCJYvWzoK+ST7XkusPkC3qX2MZBgZ0AV3b+xF+DT9F/ KhV1UDGXf0rfM3dWqEqbktIjNsBRnbFCIdNmpSpUHxKq90iGCv3A4XOUJKUKfeun YYqKDRsUBephUI1q9vsPJkVaH6fOZMMXh00a1+BigACgWpddQlElkLax8ByrMoGu oKhz+RvGmkZ0iffFfd11bcH1ZRv946dOb8xEGWpKrJsIMFv08gTQ3ldCYRfogbwt y+U5CPWrDuvUtUZm+/ulN9keYGROUYD9xLn6aUTOI8g== 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=fm3; bh=z3wpOM 3wEenkSR66nQ40DCjllIN91iuyW7X5dn7OvyU=; b=q2R7ibAgqSQqc8/HVsnw1q dcBOU81tHLTCKrHET+/Ver7AUWSBw5GFp1evxg7yhFPbUlmRIg1Qcw1SmGttEev0 BthHPKDBUgAFcqkeoDoBRPxcjJveSjBB6lMKoSZ+stlRHqolwJ32mY15bHwFxQwm YEBDs4Uecmh5fEhlKeJTOZSL0w/re4U7YlK5Oz+ipunJOPwGtdMCbSiCzotY9T9X Z/4V9E235TmbFstJWzblPdebwUb9KuKnWSkJaAEDtImkLSykQsJfC94dbODPxDct ViA7lQ/TfFwxU7FbEUHLMT6YgHF2frs04MEL02JDylN5dkHym0mxyWERSpTsCIiQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudefkedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpedvgeduuefhtdeuleettdevjeeh heeiveeuieegleetgeeljeelieeuieehgeevhfenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Sep 2021 23:44:51 -0400 (EDT) Date: Thu, 9 Sep 2021 12:44:45 +0900 From: Michael Paquier To: "wangsh.fnst@fujitsu.com" Cc: Andrew Dunstan , PostgreSQL Hackers Subject: Re: drop tablespace failed when location contains .. on win32 Message-ID: References: <9d81c415-d15e-743e-1394-b28bdcdd27ae@dunslane.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mvW+OCSDWEaLbn+8" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --mvW+OCSDWEaLbn+8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 09, 2021 at 02:35:52AM +0000, wangsh.fnst@fujitsu.com wrote: > Do you mean changing the action of canonicalize_path(), like remove all t= he (..) ? >=20 > I'm willing to fix this problem. Looking at canonicalize_path(), we have already some logic around pending_strips to remove paths when we find a "/.." in the path, so that's a matter of adjusting this area to trim properly the previous directory. On *nix platforms, we don't apply this much caution either, say a simple /tmp/path/../path/ results in this same path used in the link =66rom pg_tblspc. But we are speaking about Windows here, and junction points. Based on the lack of complains over the years, that does not seem really worth backpatching. Just my 2c on this point. -- Michael --mvW+OCSDWEaLbn+8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmE5gy0ACgkQnvQgOdby QH0izA//XPiFvvfQzlBeIoXb6iDFEbhggflxSYk4NdP6tQmVYHq0S82IpVObQTbz 1GxLzKJMj5LVlNruL9ZeHapSblWFK0EhyHKt3jDyly0yi6U49Xqz3+ih87ib9rgs vEqD5cHvjsMEqG4a3IjMOHXx2fbVS4mGqtrTI4pUfY6IPCoGmn99bDllGmd0mj2V Yf7rxo4J3S9aOs7TQ735I+4uL//Ur20wauLkEkZNKVZ1LfG1PqAdaDwMcUstxWOW uoj1cXF/v5Q+py7gnX+rjMs0IGN+W1gdxJAaUqxmRA4Ovig1JY7ZD3EpmOURbirk VKDLg/3ErVkeLnWut+CalsYKsYVYg1eacc9KxfxG4XYkSY3kco4nJlqJflZFImza rqvmk3NRb7fuQgZWujLPqCNXhb08S9N2+Gg1kFfWlTkSx7VXLuqim0Qt2Ej+P6XU ojMm5d44e6JOjAPUdVxRzKfvf53h5M6BMPKki6VJH1aUWcchzRIylXKiQzqODRQT /EWyQ39lR3YeUC6uAE+xCtF+/GuPvcBN9u3TEwhsP1HgqpMC/+zR1fyU/jlx2xcD T+AYPgu4HBdrOPFoyOp9zCst743JcHbmb4xzcrNwxt0vI2xdYOwVdr5nI7n4DrC1 W5/9UFGvekX3yzWNbpOXwN6OMgoU2KDhHhNGpLPlv348s7fcf1E= =/Kht -----END PGP SIGNATURE----- --mvW+OCSDWEaLbn+8--