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

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: drop tablespace failed when location contains .. on win32
Дата
Msg-id YT74jO2LwChTmE58@paquier.xyz
обсуждение исходный текст
Ответ на RE: drop tablespace failed when location contains .. on win32  ("wangsh.fnst@fujitsu.com" <wangsh.fnst@fujitsu.com>)
Ответы Re: drop tablespace failed when location contains .. on win32  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-hackers
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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Corey Huinker
Дата:
Сообщение: Re: WIP: System Versioned Temporal Table
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Allow escape in application_name