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

Поиск
Список
Период
Сортировка
От wangsh.fnst@fujitsu.com
Тема RE: drop tablespace failed when location contains .. on win32
Дата
Msg-id TY2PR01MB421975D9184BAF6FBAC2262BF2D89@TY2PR01MB4219.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на Re: drop tablespace failed when location contains .. on win32  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: drop tablespace failed when location contains .. on win32  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Hi,

> -----Original Message-----
> From: Andrew Dunstan <andrew@dunslane.net>
> Sent: Thursday, September 9, 2021 8:30 PM

> I think I would say that we should remove any "." or ".." element in the
> path except at the beginning, and in the case of ".." also remove the
> preceding element, unless someone can convince me that there's a problem
> with that.

These WIP patches try to remove all the '.' or '..' in the path except at
the beginning.

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/".

But this modification will lead to a regress test failure on Windows:
> -- Will fail with bad path
> CREATE TABLESPACE regress_badspace LOCATION '/no/such/location';
> -ERROR:  directory "/no/such/location" does not exist
> +ERROR:  tablespace location must be an absolute path

Do you think this modification is necessary ?

Rest of the modification is in 0002. I think this patch need more test and review.

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 will add this to next commitfest after further test .

Regards.
Shenhao Wang

Вложения

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Confusing messages about index row size
Следующее
От: Etsuro Fujita
Дата:
Сообщение: Doc: Extra type info on postgres-fdw option import_generated in back branches