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.98.2) (envelope-from ) id 1x7cZj-00000000WSd-3uAP for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Sep 2026 17:40:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1x7cZj-00000002sDO-12HN for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Sep 2026 17:40:39 +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.98.2) (envelope-from ) id 1x7cXt-00000002pxS-1KdF for pgsql-hackers@lists.postgresql.org; Fri, 18 Sep 2026 17:38:45 +0000 Received: from mail-vs2-x0d.google.com ([2a00:1450:4864:3a::d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x7cXr-000000004hT-0PbM for pgsql-hackers@lists.postgresql.org; Fri, 18 Sep 2026 17:38:45 +0000 Received: by mail-vs2-x0d.google.com with SMTP id 71dfb90a1353d-5c67e5059fbso342256e0c.3 for ; Fri, 18 Sep 2026 10:38:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789753120; x=1790357920; darn=lists.postgresql.org; h=content-transfer-encoding:content-type: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 :content-type; bh=6MMA/2eDBnpS1tMOAmyMoBUO318LotCMdzkkH2eMDpo=; b=UFCUqRPw/y+RPuH9EQ7gz91AC7I7GWp/TG2IjyELFiqcSVw1eE7OEBy/epYwBr6MuL 1XAM9PQFRzN1OdhsdjM10NqEiloiXrrLy8RVcQJpBP9wZP4hnFWv9Zjw9E+ktmVyup9s D/DOLTgbaCd7b9TPiFpEWD9kBeTFaZCRGkgm33UVMGo6rS3HDq0mR/EV6YiyRXTebaoG 7e8voDsNiruoBvY8s9X7RGfkCc3MVJFw/pV13iwsRgpANHMbIP0kfnWKSY9KjsWIKTRk cCXG+EKHWH20EUaeb6pIX/7sdzLmIRiyby/AyLa8ageixHCoHDAuzMCdd5bUKYcsi+2f wGKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789753120; x=1790357920; h=content-transfer-encoding:content-type: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:content-type; bh=6MMA/2eDBnpS1tMOAmyMoBUO318LotCMdzkkH2eMDpo=; b=WTOLp+QupRiV13BkjuToDy0ydoCmmvAh3lvvitohWPmHBvuDjJeXvFjE0glCY9bQqE 87a3FkKZRCvWZGHbRssGIBXlRx+N4ATiEqsv9E2yio/KpWZEvykDqvSErvMj2/EA8aYL LN65E08hjVYJcKPIc0DGlCmA/kbphtnnLQjlSogvUCD4HbpMgz8dWo+rrwBbpLfIcY1r opngnA9FQq+8+O+Inp8HGPpDXiCS/BaQBCjOS7xgZn/F4CBOoVdv7W9G8n1KYOCfeoUP yDfHZUf0xjAqnpYovjzoeAVkYqyQ5T39I6fU/NCUQ/DTub9QxisU5e0VhKT5c7RPW60f gKuQ== X-Forwarded-Encrypted: i=1; AKwUvBxXfXqS7nyuqA/bIFIi4V7jpuK/YUWKcW7AjLd5R17ZdXusmEupbgDkeQy9Y6jvQnzBQ34JZyWqFZyRkUsp@lists.postgresql.org X-Gm-Message-State: AFuF++mJnc0sHwV3NAdFjKzLuXM+mf0NKjUnvkQsQWJvXft8Sv9PQxjt X1qN9gGXRq6B/KGppDoaiWQ2veKNRP4aAjjp2U2Mml7CApHslsUt3R8S X-Gm-Gg: AYBFou2MGhUA2vuTV9e1smYmWfTR7w23h8jv0+FJwbm2xYPU/WJwF0YgOJs1GsNIapH 0wB9BUubES9Mnq3J+JhZWd8pPEtxArB+S9k58OMvLNleLFIm5Miwf9StCo+SZj83Kawh44g1+X1 pm24O58cvLefM9jawX72c1dupvO2BlJyAtyVCR6svdDCVYTTMPCnRcsewAnugByNKApLJMeazTl PGMI3PGJOb3r7iCAKaK32T6QIXDS3WZbYveh2/wVHORAkLVY+iPKFfjwbXWtl0ytyOHo7zwXjoW 0hznM3UdH13/jCYpn4GVqxeqDdA8EIBHOI3xdoBHScB45nwWqbt17+2ylozjTg9BOwlpB99j7ad NHjZ+HpAV32NZQ6wm229+ge/HyyzORTpM+BPtwPKk5/84bMpShuJWbBR4huVb2Yh32lp/FoQfDd HoeSBwzo0hFkF5D5r/AOGTRl5u8KrDgVrm8JB6N/vppAUJ7LKUmIieaATRmsuIIAVeD3BbCECzd 6lHqibjM2Y= X-Received: by 2002:a05:6122:17a2:b0:5c7:a814:b987 with SMTP id 71dfb90a1353d-5c9b8a6c1e0mr1396654e0c.2.1789753120055; Fri, 18 Sep 2026 10:38:40 -0700 (PDT) Received: from [192.168.88.177] ([201.176.245.118]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-5c9c198031bsm168923e0c.16.2026.09.18.10.38.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Sep 2026 10:38:39 -0700 (PDT) Message-ID: <4e1abcc3-a231-450a-8170-765e53ebb8a3@gmail.com> Date: Fri, 18 Sep 2026 14:38:31 -0300 MIME-Version: 1.0 User-Agent: Betterbird (Linux) Subject: Re: [PATCH] libpq: Add PQpassfileLookup() To: Denis Smirnov Cc: Grigorev Jurij , Jacob Champion , "pgsql-hackers@lists.postgresql.org" References: <56a73ea31de54ebea53877367cdd6abf@localhost.localdomain> <00e741a7-8dc1-4993-87f4-8976e9c3b6ba@gmail.com> <8b93e9c7642b47b49d5b287ed032b00a@localhost.localdomain> <5b8e0436-853d-4b5e-8546-1862faf84cc6@gmail.com> Content-Language: en-US From: Diego 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 Hi Denis, Thank you, and thanks for the review that found the residue in the first place. > One separate note for future work: even after 0001, copies of the > password can still remain in memory: Agreed on all four, and I had noticed two of them while checking 0001: on an allocation failure, enlargePQExpBuffer() ends up in markPQExpBufferBroken(), which free()s the block still holding the partially read line and sets maxlen to 0, so the explicit_bzero(buf.data, buf.maxlen) further down becomes a no-op on the replacement buffer. I left it alone because fixing it properly means touching pqexpbuffer.c, which is a different patch and a different discussion. The stdio buffer is the largest of the four by far, it can hold the whole file, not just one line, and it is also the only one that is there on every successful lookup rather than only on an error path. If nobody objects I will look at that one separately once this is settled, probably with setvbuf() on an owned buffer that can be cleared before fclose(). I'll leave those out of this thread so they do not hold up the API. Since you and Yuriy are both happy with the series, I'll move the CF entry to Ready for Committer. Thanks, Diego