Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vxQjm-00Decx-1B for pgsql-bugs@arkaria.postgresql.org; Tue, 03 Mar 2026 14:28:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vxQjk-007Hrw-2d for pgsql-bugs@arkaria.postgresql.org; Tue, 03 Mar 2026 14:28:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vxQjk-007Hro-1r for pgsql-bugs@lists.postgresql.org; Tue, 03 Mar 2026 14:28:37 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vxQji-00000000C24-1u0q for pgsql-bugs@lists.postgresql.org; Tue, 03 Mar 2026 14:28:36 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 623ESO9n1003731; Tue, 3 Mar 2026 09:28:27 -0500 From: Tom Lane To: 1003931418@qq.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19423: canonicalize_path does not function correctly when processing paths that contain . and .. In-reply-to: <19423-a45c4524977e1704@postgresql.org> References: <19423-a45c4524977e1704@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Tue, 03 Mar 2026 07:27:44 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1003729.1772548104.1@sss.pgh.pa.us> Date: Tue, 03 Mar 2026 09:28:24 -0500 Message-ID: <1003730.1772548104@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form 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