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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, "wangsh(dot)fnst(at)fujitsu(dot)com" <wangsh(dot)fnst(at)fujitsu(dot)com>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: drop tablespace failed when location contains .. on win32
Date: 2022-01-31 17:18:56
Message-ID: 684309.1643649536@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> On 1/30/22 16:50, Tom Lane wrote:
>> Here's a revised patch version that does it like that. I also
>> reviewed and simplified the canonicalize_path logic. I think
>> this is committable.

> LGTM

Pushed, thanks for looking.

I think I'm also going to have a look at simplifying some of the
dependent code, just because it feels weird to leave that unfinished.
In particular, Shenhao-san suggested upthread that we could remove
path_contains_parent_reference(). I complained about that at the
time, but I hadn't quite absorbed the fact that an absolute path
is now *guaranteed* not to have any ".." after canonicalize_path.
So the existing calls in adminpack.c and genfile.c are certainly
dead code. We probably want to keep path_contains_parent_reference()
in case some extension is using it, but seeing that its API spec
already requires the input to be canonicalized, it could be simplified
to just check for ".." at the start.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2022-01-31 17:29:40 Re: CREATEROLE and role ownership hierarchies
Previous Message Mark Dilger 2022-01-31 17:18:12 Re: CREATEROLE and role ownership hierarchies