1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-05 23:56:58 +03:00

Remove feof(stdin) calls related to when to prompt for a password,

leftovers from when the password was read from stdin.
This commit is contained in:
Peter Eisentraut 2009-02-25 13:24:40 +00:00
parent cd3b750929
commit a3c502c89f
7 changed files with 14 additions and 21 deletions

View File

@ -5,7 +5,7 @@
* Originally by * Originally by
* B. Palmer, bpalmer@crimelabs.net 1-17-2001 * B. Palmer, bpalmer@crimelabs.net 1-17-2001
* *
* $PostgreSQL: pgsql/contrib/oid2name/oid2name.c,v 1.33 2007/12/11 02:31:49 tgl Exp $ * $PostgreSQL: pgsql/contrib/oid2name/oid2name.c,v 1.34 2009/02/25 13:24:40 petere Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
@ -293,8 +293,7 @@ sql_conn(struct options * my_opts)
if (PQstatus(conn) == CONNECTION_BAD && if (PQstatus(conn) == CONNECTION_BAD &&
PQconnectionNeedsPassword(conn) && PQconnectionNeedsPassword(conn) &&
password == NULL && password == NULL)
!feof(stdin))
{ {
PQfinish(conn); PQfinish(conn);
password = simple_prompt("Password: ", 100, false); password = simple_prompt("Password: ", 100, false);

View File

@ -4,7 +4,7 @@
* A simple benchmark program for PostgreSQL * A simple benchmark program for PostgreSQL
* Originally written by Tatsuo Ishii and enhanced by many contributors. * Originally written by Tatsuo Ishii and enhanced by many contributors.
* *
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.83 2009/01/01 17:23:32 momjian Exp $ * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.84 2009/02/25 13:24:40 petere Exp $
* Copyright (c) 2000-2009, PostgreSQL Global Development Group * Copyright (c) 2000-2009, PostgreSQL Global Development Group
* ALL RIGHTS RESERVED; * ALL RIGHTS RESERVED;
* *
@ -309,8 +309,7 @@ doConnect(void)
if (PQstatus(conn) == CONNECTION_BAD && if (PQstatus(conn) == CONNECTION_BAD &&
PQconnectionNeedsPassword(conn) && PQconnectionNeedsPassword(conn) &&
password == NULL && password == NULL)
!feof(stdin))
{ {
PQfinish(conn); PQfinish(conn);
password = simple_prompt("Password: ", 100, false); password = simple_prompt("Password: ", 100, false);

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/contrib/vacuumlo/vacuumlo.c,v 1.37 2009/01/01 17:23:32 momjian Exp $ * $PostgreSQL: pgsql/contrib/vacuumlo/vacuumlo.c,v 1.38 2009/02/25 13:24:40 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -91,8 +91,7 @@ vacuumlo(char *database, struct _param * param)
if (PQstatus(conn) == CONNECTION_BAD && if (PQstatus(conn) == CONNECTION_BAD &&
PQconnectionNeedsPassword(conn) && PQconnectionNeedsPassword(conn) &&
password == NULL && password == NULL)
!feof(stdin))
{ {
PQfinish(conn); PQfinish(conn);
password = simple_prompt("Password: ", 100, false); password = simple_prompt("Password: ", 100, false);

View File

@ -5,7 +5,7 @@
* Implements the basic DB functions used by the archiver. * Implements the basic DB functions used by the archiver.
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.81 2009/02/02 20:07:37 adunstan Exp $ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.82 2009/02/25 13:24:40 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -241,8 +241,7 @@ ConnectDatabase(Archive *AHX,
if (PQstatus(AH->connection) == CONNECTION_BAD && if (PQstatus(AH->connection) == CONNECTION_BAD &&
PQconnectionNeedsPassword(AH->connection) && PQconnectionNeedsPassword(AH->connection) &&
password == NULL && password == NULL)
!feof(stdin))
{ {
PQfinish(AH->connection); PQfinish(AH->connection);
password = simple_prompt("Password: ", 100, false); password = simple_prompt("Password: ", 100, false);

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* *
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.116 2009/02/25 13:03:06 petere Exp $ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.117 2009/02/25 13:24:40 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -1358,8 +1358,7 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport,
if (PQstatus(conn) == CONNECTION_BAD && if (PQstatus(conn) == CONNECTION_BAD &&
PQconnectionNeedsPassword(conn) && PQconnectionNeedsPassword(conn) &&
password == NULL && password == NULL)
!feof(stdin))
{ {
PQfinish(conn); PQfinish(conn);
password = simple_prompt("Password: ", 100, false); password = simple_prompt("Password: ", 100, false);

View File

@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2009, PostgreSQL Global Development Group * Copyright (c) 2000-2009, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.153 2009/01/01 17:23:55 momjian Exp $ * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.154 2009/02/25 13:24:40 petere Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
@ -189,8 +189,7 @@ main(int argc, char *argv[])
if (PQstatus(pset.db) == CONNECTION_BAD && if (PQstatus(pset.db) == CONNECTION_BAD &&
PQconnectionNeedsPassword(pset.db) && PQconnectionNeedsPassword(pset.db) &&
password == NULL && password == NULL)
!feof(stdin))
{ {
PQfinish(pset.db); PQfinish(pset.db);
password = simple_prompt(password_prompt, 100, false); password = simple_prompt(password_prompt, 100, false);

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.33 2009/01/01 17:23:55 momjian Exp $ * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.34 2009/02/25 13:24:40 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -124,8 +124,7 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport,
if (PQstatus(conn) == CONNECTION_BAD && if (PQstatus(conn) == CONNECTION_BAD &&
PQconnectionNeedsPassword(conn) && PQconnectionNeedsPassword(conn) &&
password == NULL && password == NULL)
!feof(stdin))
{ {
PQfinish(conn); PQfinish(conn);
password = simple_prompt("Password: ", 100, false); password = simple_prompt("Password: ", 100, false);