Re: BUG #10347: Can't write password to psql or pg_dump - Mailing list pgsql-bugs

From Andres Freund
Subject Re: BUG #10347: Can't write password to psql or pg_dump
Date
Msg-id 20140518102324.GV23662@alap3.anarazel.de
Whole thread Raw
In response to BUG #10347: Can't write password to psql or pg_dump  (derek_ealy@rapid7.com)
Responses Re: BUG #10347: Can't write password to psql or pg_dump  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #10347: Can't write password to psql or pg_dump  (Noah Misch <noah@leadboat.com>)
List pgsql-bugs
Hi,

On 2014-05-16 20:34:09 +0000, derek_ealy@rapid7.com wrote:
> On Windows systems the psql or pg_dump process always hangs after sending
> the password to stdin of the process.
>
> I've gotten around this problem by setting an environment variable before
> exec'ing the process. I set OSTYPES=msys. This forces psql to use stdin when
> reading the password.

I think the important point - and why I asked for a bugreport after
talking about it on irc - is that sprompt.c on windows uses
CONIN$/CONOUT$ for io. Ignoring stdin/stdout except when the OSTYPE is
set to msys. Given that CONIN$/OUT seem to refer to the shell that
started a processtree from a shell that doesn't seem to be optimal.

That said, I am not a big fan of relying on sending the passwort to
stdin...

Greetings,

Andres Freund

--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

pgsql-bugs by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: BUG #10347: Can't write password to psql or pg_dump
Next
From: Tom Lane
Date:
Subject: Re: BUG #10347: Can't write password to psql or pg_dump