Re: drop tablespace failed when location contains .. on win32

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: michael(at)paquier(dot)xyz
Cc: wangsh(dot)fnst(at)fujitsu(dot)com, andrew(at)dunslane(dot)net, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: drop tablespace failed when location contains .. on win32
Date: 2021-09-13 08:36:29
Message-ID: 20210913.173629.689388354506122738.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Mon, 13 Sep 2021 16:06:52 +0900, Michael Paquier <michael(at)paquier(dot)xyz> wrote in
> On Sun, Sep 12, 2021 at 07:33:23AM +0000, wangsh(dot)fnst(at)fujitsu(dot)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?

Mmm. I haven't thought that so seriously, but '/hoge/foo/bar' doesn't
seem to be an absolute path on Windows since it lacks
"<dirver-letter>:" or "//hostname" part. If we're on drive D:,
"/Program\ Files" doesn't mean "C:\Program\ Files" but "D:\Program\
Files".

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2021-09-13 08:45:47 Re: Doc: Extra type info on postgres-fdw option import_generated in back branches
Previous Message gkokolatos 2021-09-13 08:35:43 Re: Teach pg_receivewal to use lz4 compression