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.94.2) (envelope-from ) id 1se2Z5-003L0X-Fk for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Aug 2024 01:12:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1se2Z4-007LqK-14 for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Aug 2024 01:12:38 +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.94.2) (envelope-from ) id 1se2Z3-007LqB-Jl for pgsql-hackers@lists.postgresql.org; Wed, 14 Aug 2024 01:12:37 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1se2Z0-004joo-Sj for pgsql-hackers@postgresql.org; Wed, 14 Aug 2024 01:12:36 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id AC7A56C0A6 for ; Wed, 14 Aug 2024 03:12:33 +0200 (CEST) Received: from s934.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id 92EDC6BE68; Wed, 14 Aug 2024 03:12:33 +0200 (CEST) Received: from s471.loopia.se (unknown [172.22.191.5]) by s934.loopia.se (Postfix) with ESMTP id 9156F7CE964; Wed, 14 Aug 2024 03:12:33 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s471.loopia.se (amavisd-new); dkim=pass (2048-bit key) header.d=proxel.se Received: from s981.loopia.se ([172.22.191.6]) by s471.loopia.se (s471.loopia.se [172.22.190.35]) (amavisd-new, port 10024) with LMTP id aKzy2p-jKpBk; Wed, 14 Aug 2024 03:12:33 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: andreas@proxel.se X-Loopia-Originating-IP: 147.28.75.140 Received: from [192.168.0.121] (customer-147-28-75-140.stosn.net [147.28.75.140]) (Authenticated sender: andreas@proxel.se) by s981.loopia.se (Postfix) with ESMTPSA id CDF2022B1692; Wed, 14 Aug 2024 03:12:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxel.se; s=loopiadkim1707418970; t=1723597953; bh=EV73BedPrDgHpV73n1eEqAMaDf0eIqFIBh1lnjBcAaE=; h=Date:Subject:To:References:From:In-Reply-To; b=XZFcLdKxIYGRq2bUCjVIC/Ud5ofAFSEBJTAH8nQkX+7fMwYyVkaItQr+basmeOkVh olzIKjBTCl9YYdI0P9blsSrQX6XOO9xKw6Z+/QhQMXFpmdq4wtwsVk+fyWSCPjqy8J oORFa9yhyDFH4iPX7v5h08vL/aGJI2aOBmg7c7yF4kRNoG11wmBhOvZt9tRBY6GsaM WWAxSYt1NBjiAG95wpSC6jnDHbwik7u2ebwKjDJpqUzqrRKSJJvZoGGWGTfgSXtny2 vqvBgAdG7X+PdSHATFLZszklNzIff8FEdJRhvUjXGgIBfsmH2gau9QzXP7jxIiJyep 56WAyG4V59VWQ== Message-ID: <6c9c47ed-5978-45e5-98f3-30200ead73ef@proxel.se> Date: Wed, 14 Aug 2024 03:12:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: libpq minor TOCTOU violation To: Peter Eisentraut , pgsql-hackers References: Content-Language: en-US From: Andreas Karlsson In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/10/24 9:10 AM, Peter Eisentraut wrote: > Thoughts? I like it. Not because of the security issue but mainly because it is more correct to do it this way. Plus the old code running stat() on Windows also made little sense. I think this simple fix can be committed. Andreas