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>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Subject: Re: drop tablespace failed when location contains .. on win32
Date: Mon, 13 Sep 2021 16:06:52 +0900
Message-ID: <YT74jO2LwChTmE58@paquier.xyz> (raw)
In-Reply-To: <TY2PR01MB421975D9184BAF6FBAC2262BF2D89@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>
	<YTmDLXnd10Uf2n5H@paquier.xyz>
	<5dc0799e-82ab-cc86-6dc6-915412f2585a@dunslane.net>
	<TY2PR01MB421975D9184BAF6FBAC2262BF2D89@TY2PR01MB4219.jpnprd01.prod.outlook.com>

On Sun, Sep 12, 2021 at 07:33:23AM +0000, wangsh.fnst@fujitsu.com wrote:
> 0001 is a small fix, because I find that is_absolute_path is not appropriate, 
> see comment in skip_drive:
> > * On Windows, a path may begin with "C:" or "//network/".

 #define is_absolute_path(filename) \
 ( \
-       IS_DIR_SEP((filename)[0]) || \
+       (IS_DIR_SEP((filename)[0]) && IS_DIR_SEP((filename)[1])) || \
        (isalpha((unsigned char) ((filename)[0])) && (filename)[1] == ':' && \
         IS_DIR_SEP((filename)[2])) \
With this change you would consider a path beginning with "/foo/.." as
not being an absolute path, but that's not correct.  Or am I missing
 something obvious?

> 0003 is a test extension for me to check the action of canonicalize_path.
> Do you think is necessary to add this test extension(and some test scripts) to master ?
> If necessary,  maybe I can use the taptest to test the action of canonicalize_path
> in Linux and Windows.

I am not sure that this is worth the cycles spent on, so I would
discard it.  This will help a lot in reviewing this patch, for sure.
And you could add some regression tests to show how much testing you
have done, for both WIN32 and non-WIN32.  I do that from time to time,
and was actually thinking to test this API this way.
--
Michael

Attachments:

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

view thread (23+ messages)  latest in thread

Message-ID: <YT74jO2LwChTmE58@paquier.xyz>
Permalink:  ../YT74jO2LwChTmE58@paquier.xyz/
Also on:    postgresql.org/message-id/YT74jO2LwChTmE58@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, horikyota.ntt@gmail.com
  Subject: Re: drop tablespace failed when location contains .. on win32
  In-Reply-To: <YT74jO2LwChTmE58@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> <5dc0799e-82ab-cc86-6dc6-915412f2585a@dunslane.net> <TY2PR01MB421975D9184BAF6FBAC2262BF2D89@TY2PR01MB4219.jpnprd01.prod.outlook.com> <YT74jO2LwChTmE58@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