Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fLcq6-0001Ct-CX for pgsql-hackers@arkaria.postgresql.org; Wed, 23 May 2018 23:06:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fLcq3-0005bu-W9 for pgsql-hackers@arkaria.postgresql.org; Wed, 23 May 2018 23:06:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fLcq3-0005bh-PF for pgsql-hackers@lists.postgresql.org; Wed, 23 May 2018 23:06:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fLcq0-0003iv-VP for pgsql-hackers@lists.postgresql.org; Wed, 23 May 2018 23:06:35 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w4NN6Tbb016098; Wed, 23 May 2018 19:06:29 -0400 From: Tom Lane To: Matthew Stickney cc: pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] (Windows) psql echoes password when reading from pipe In-reply-to: References: <502a1fff-862b-da52-1031-f68df6ed5a2d@gmail.com> <14853.1527015354@sss.pgh.pa.us> <18079.1527019746@sss.pgh.pa.us> <23826.1527027253@sss.pgh.pa.us> Comments: In-reply-to Matthew Stickney message dated "Wed, 23 May 2018 15:29:29 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16096.1527116789.1@sss.pgh.pa.us> Date: Wed, 23 May 2018 19:06:29 -0400 Message-ID: <16097.1527116789@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Matthew Stickney writes: > The attached is a patch that uses the _fileno/_get_osfhandle approach. > This doesn't address the stdin fallback, or error handling if opening > termin fails; however, it should be no worse than what's there now, and > it fixes the immediate problem. LGTM; pushed with some cosmetic changes. > I'm still thinking about the fallback in terms of a mintty-type > environment, but I wanted to get this patch out there in the meantime. Yeah. I'm not absolutely sure that we need to do anything there, given the lack of field complaints; but if we can think of a simple way to make it more bulletproof, all the better. regards, tom lane