pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: wangsh.fnst@fujitsu.com <wangsh.fnst@fujitsu.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: drop tablespace failed when location contains .. on win32
Date: Thu, 9 Sep 2021 12:44:45 +0900
Message-ID: <YTmDLXnd10Uf2n5H@paquier.xyz> (raw)
In-Reply-To: <TY2PR01MB4219D9BBF0FFF4097322C61FF2D59@TY2PR01MB4219.jpnprd01.prod.outlook.com>
References: <OSBPR01MB4214FA221FFE046F11F2AD74F2D49@OSBPR01MB4214.jpnprd01.prod.outlook.com>
	<9d81c415-d15e-743e-1394-b28bdcdd27ae@dunslane.net>
	<YTlvMKqBbyif6PWJ@paquier.xyz>
	<TY2PR01MB4219D9BBF0FFF4097322C61FF2D59@TY2PR01MB4219.jpnprd01.prod.outlook.com>

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 the (..) ?
> 
> 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
from 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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (23+ messages)  latest in thread

Message-ID: <YTmDLXnd10Uf2n5H@paquier.xyz>
Permalink:  ../YTmDLXnd10Uf2n5H@paquier.xyz/
Also on:    postgresql.org/message-id/YTmDLXnd10Uf2n5H@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: michael@paquier.xyz, wangsh.fnst@fujitsu.com, andrew@dunslane.net
  Subject: Re: drop tablespace failed when location contains .. on win32
  In-Reply-To: <YTmDLXnd10Uf2n5H@paquier.xyz>
  References: <OSBPR01MB4214FA221FFE046F11F2AD74F2D49@OSBPR01MB4214.jpnprd01.prod.outlook.com> <9d81c415-d15e-743e-1394-b28bdcdd27ae@dunslane.net> <YTlvMKqBbyif6PWJ@paquier.xyz> <TY2PR01MB4219D9BBF0FFF4097322C61FF2D59@TY2PR01MB4219.jpnprd01.prod.outlook.com> <YTmDLXnd10Uf2n5H@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox