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 1wRrrF-002lMa-24 for pgsql-hackers@arkaria.postgresql.org; Tue, 26 May 2026 13:30:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wRrrB-004WiB-0G for pgsql-hackers@arkaria.postgresql.org; Tue, 26 May 2026 13:30:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wRrrA-004Wi3-2Y for pgsql-hackers@lists.postgresql.org; Tue, 26 May 2026 13:30:05 +0000 Received: from mail-ua1-x936.google.com ([2607:f8b0:4864:20::936]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wRrr9-00000000rHY-2diX for pgsql-hackers@postgresql.org; Tue, 26 May 2026 13:30:04 +0000 Received: by mail-ua1-x936.google.com with SMTP id a1e0cc1a2514c-95cc3522c40so7529859241.2 for ; Tue, 26 May 2026 06:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779802202; x=1780407002; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=y7SH0boA9pRRMiYQ2kUa71N3BJYoBzUqF/+/tibnZW8=; b=Hv242+1bpOHaB7QobwfsslCiPhxNVc/V9yVuA7aaG4TG7qquDl8/PYqlNFAUStDzUP OMNZchGIY5Kqv2YJsRHCgV78S4jOFCN/hCVqyQBPQ5OeeezwOQvVWuXCt/WlyZj5oLYU 8ygUhxrp6tbXBz8mvaHotw34QaeRwr+0gK9R4mVbCmKqqQF3FT2tRebfL8T2SlIZAB2L YCtqQl6WqLFRdZ0rGUosgMruIAhXfHVKaTll71OTFjnF1qxMzJK85ZJwP6FsB/vgHgnK 4mn8PIAMiUkJqW9hvIe6YayEBm6+swRbBQmJWvRF6KpWZ9rnbT6MnT5EFYcoZehySBbw Pucw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779802202; x=1780407002; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=y7SH0boA9pRRMiYQ2kUa71N3BJYoBzUqF/+/tibnZW8=; b=agRT8fJQdtdR1rAlVnweOiy6qY0TQ+X2dWEijpihhlgoEDr6twW5suVG4AHkwPU9SP r9Es4suqFbebrAcHRKFJqUzkefD40XyMMhzRnWrY2qsJE7fdiK687geqETB4dHZ8MO0C /RIvsQNSiZyrC24Y8v2wTFQKPstEQtR+SIwjn+co7xITMlP6o6f6cyYLDj4CXtnnvGHL 0raK7BCUrvUselG5Dq8yqITNyUN5OpciX0hI34eBFBI75NuISaVH8EFMpYfFSzKQJ2I+ CyiRfKBXagDVX3cyvbc7jfPLx72Rhqm8H94LJLPxzn/Us1OENIjzpR0DY5y83vR4zGmH d7OQ== X-Forwarded-Encrypted: i=1; AFNElJ+QNLBwEpaQtlRRXngsSO6TcOv1kP+7xY0/pXpDKAtk6QK079IWXqYS/s0aYNhysxYHL1qnUvaidraM1y+j@postgresql.org X-Gm-Message-State: AOJu0YyFGMdzL3C5Q9/XYP4geU47Qxm75TFszcGcjWqOrUkt6mBL9ai6 hrpD6iAO5QIf2xw1PbMwDbh37ufFjasoR+c+KfeJZZ4rald5l7U/OpKz X-Gm-Gg: Acq92OEXUuzDbtJSPFBQtm3GW9B68qd9QVyIYCNIR775XxrzbqVPJrmVp5W0w0BZwlv z8hmoaZA4S+igqUJuBXhFRnKCFBlL+KwHWT9FK3ZTc/NnuV3+PvpcRihzjQjYVKEWJA42Xn22+/ 1zwbigiZ7ToPkYHmEXaUEBxIRax3aSWc21sINmUbjZUNGMkTtwXUIdEAHQR4ZLd3m4KuxGo3Lzo nhRBGPLPWvg1FL0iPo3A+GMAE/sWuv99fJWEYWaxhGdaoGC36E/ETUUrrVvKVqFZOv9xD+F56sD MH3u+6+1swMHuS3+dKOB4q07qUjNnmfNSJDFH1NeEWn8S10AagEdmn5ns+7kiKJaAhbSa8VTJgH de2xYepHpsu4yn0sC2T8FtGGPxLn8tyzImihtuKE1dICc3hjaMttcNCw9WXvBBDkYAYoIoIl/Gs v7AraMveRT+8hKLCLp+pMtLvtw17NggtpMdnYHTWKPRUvgWoWsJWu9nSaNDeGavrSWiIjCRq40M Iect2RvaC6Dnn5HXBFplw== X-Received: by 2002:a05:6102:1494:b0:633:34c6:6ace with SMTP id ada2fe7eead31-67c8293fb73mr9696564137.26.1779802202107; Tue, 26 May 2026 06:30:02 -0700 (PDT) Received: from ?IPV6:2804:14d:328a:a59c:1166:2b6a:3001:a372? ([2804:14d:328a:a59c:1166:2b6a:3001:a372]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-96173b6b08bsm13597320241.11.2026.05.26.06.30.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 May 2026 06:30:01 -0700 (PDT) Message-ID: Date: Tue, 26 May 2026 10:29:58 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Avoid leaking system path from pg_available_extensions To: Chao Li Cc: Jim Jones , PostgreSQL-development , Andrew Dunstan References: <357C774A-ECE9-4455-B641-315205D4D9A1@gmail.com> <96203151-6929-4d88-85a0-d552ee258a24@gmail.com> <87c8f8ac-614b-4679-afc7-f591b76c8ff7@gmail.com> <83AF10FE-7655-43DF-A302-3CAC796B572F@gmail.com> Content-Language: en-US From: Matheus Alcantara In-Reply-To: <83AF10FE-7655-43DF-A302-3CAC796B572F@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 26/05/26 04:14, Chao Li wrote: > > >> On May 22, 2026, at 23:40, Matheus Alcantara wrote: >> >> On 22/05/26 04:25, Jim Jones wrote: >>> On 21/05/2026 17:12, Matheus Alcantara wrote: >>>> I've reproduced the issue and the fix looks correct to me. >>> same here, +1 >> >> Thank you for also testing. >> >>> I was wondering if creating a constant for it would be, stylistically >>> speaking, a cleaner solution. For instance: >>> #define EXTENSION_SYSTEM_MACRO "$system" >>> I realize that it's used only inside get_extension_control_directories() >>> but since it is even mentioned in the docs, I guess it wouldn't be a bad >>> idea. >> >> I'm not against it but I don't think that it's necessary since as you mention, only get_extension_control_directories() use. >> > > In theory, I’m not against the idea either. In practice, there are many hard-coded strings in the source tree, and I’m not sure where the right place would be to define this macro. > > Since this string is only used in get_extension_control_directories(), and now it is used three times, I defined it at the beginning of the function and undefined it at the end. Let’s see if there are any objections to that. > > Please see the attached v2. > We have such pattern in other parts of the codebase (e.g pg_resetwal.c), so it works for me. Thanks for the patch. -- Matheus Alcantara EDB: https://www.enterprisedb.com