[PATCH] Prompt for password on Windows platforms
От | Robert Kinberg |
---|---|
Тема | [PATCH] Prompt for password on Windows platforms |
Дата | |
Msg-id | 4617D1C9A5981841B2BF61010024710B05D0A5@exchhq01p.internal.tecore.com обсуждение исходный текст |
Ответы |
Re: [PATCH] Prompt for password on Windows platforms
Re: [PATCH] Prompt for password on Windows platforms |
Список | pgsql-patches |
The current version of psql, pg_dump, ... do not properly prompt the user for a password, when the backend database is setup for password authentication on a Windows platform. In investigating the code, I noticed that the file '/dev/tty' is opened to interact with the console. It appears as if on a Windows platform, the actual file /dev/tty is opened, instead of the console. I am supplying a patch to address this issue on the Windows platform. *** ./src/port/sprompt.c.orig Wed Feb 22 13:07:43 2006 --- ./src/port/sprompt.c Wed Feb 22 13:08:14 2006 *************** *** 40,47 **** { int length; char *destination; ! FILE *termin, ! *termout; #ifdef HAVE_TERMIOS_H struct termios t_orig, --- 40,47 ---- { int length; char *destination; ! FILE *termin = NULL, ! *termout = NULL; #ifdef HAVE_TERMIOS_H struct termios t_orig, *************** *** 63,70 **** --- 63,72 ---- * Do not try to collapse these into one "w+" mode file. Doesn't work on * some platforms (eg, HPUX 10.20). */ + #ifndef WIN32 termin = fopen("/dev/tty", "r"); termout = fopen("/dev/tty", "w"); + #endif if (!termin || !termout) { if (termin) Let me know what you think. Robert Kinberg
В списке pgsql-patches по дате отправления: