Re: BUG #19423: canonicalize_path does not function correctly when processing paths that contain . and ..

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: 1003931418(at)qq(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19423: canonicalize_path does not function correctly when processing paths that contain . and ..
Date: 2026-03-03 14:28:24
Message-ID: 1003730.1772548104@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> When the input parameter path of the function is
> /tmp/root_hack4_test_tablespace/./../../test, the expected result after
> processing by canonicalize_path is /test, but the actual result remains
> /tmp/root_hack4_test_tablespace/./../../test.

AFAICT it does what you're expecting in v15 and later. The previous
implementation did not promise to clean up '.' and '..' everywhere;
it only said

* o remove trailing '.'
* o process trailing '..' ourselves

> The implementation of this function differs significantly between version
> 14, version 15, and later versions.

See commit c10f830c511f0ba3e6f4c9d99f444d39e30440c8, particularly
the commit message's explanation of why not back-patch it.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Guo 2026-03-03 14:32:12 Re: BUG #19418: SQL/JSON JSON_VALUE() does not conform to ISO/IEC 9075-2:2023(E) 6.34 <JSON value constructor>
Previous Message Hayato Kuroda (Fujitsu) 2026-03-03 07:33:13 RE: [BUG] Assert failure in ReorderBufferReturnTXN during logical decoding due to leaked specinsert change