[PATCH] (Windows) psql echoes password when reading from pipe

Поиск
Список
Период
Сортировка
От Matthew Stickney
Тема [PATCH] (Windows) psql echoes password when reading from pipe
Дата
Msg-id 502a1fff-862b-da52-1031-f68df6ed5a2d@gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] (Windows) psql echoes password when reading from pipe  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
This is my first time submitting a patch here; apologies in advance if I 
flub the process.

On windows, if you pipe data to psql, the password prompt correctly 
reads from and writes to the console, but the password text is echoed to 
the console. This is because echoing is disabled on the handle for 
stdin, but as part of a pipeline stdin doesn't refer to the console. 
I've attached a patch that gets a handle to the console's input buffer 
by opening CONIN$ instead, which corrects the problem.

I think the change is straightforward enough to apply directly, but 
there's another concern that might bear discussion: SetConsoleMode can 
fail, and when it does prompt input will be echoed (i.e. it's 
fail-open). Is it worth check for and reporting for an error there? 
Given that this is meant to be used interactively, I think the risk of 
someone not noticing the echo is low.

-Matt Stickney


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Charles Cui
Дата:
Сообщение: [GSoC] github repo and initial work
Следующее
От: Tal Glozman
Дата:
Сообщение: PostgreSQL and Homomorphic Encryption