Content-Length: 567318 | pFad | http://github.com/tonybelloni/postgres/commit/a3c502c89f624aed5ee9f6e896740f86a28cc50e

AD Remove feof(stdin) calls related to when to prompt for a password, · tonybelloni/postgres@a3c502c · GitHub
Skip to content

Commit a3c502c

Browse files
committed
Remove feof(stdin) calls related to when to prompt for a password,
leftovers from when the password was read from stdin.
1 parent cd3b750 commit a3c502c

File tree

7 files changed

+14
-21
lines changed

7 files changed

+14
-21
lines changed

contrib/oid2name/oid2name.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Originally by
66
* B. Palmer, bpalmer@crimelabs.net 1-17-2001
77
*
8-
* $PostgreSQL: pgsql/contrib/oid2name/oid2name.c,v 1.33 2007/12/11 02:31:49 tgl Exp $
8+
* $PostgreSQL: pgsql/contrib/oid2name/oid2name.c,v 1.34 2009/02/25 13:24:40 petere Exp $
99
*/
1010
#include "postgres_fe.h"
1111

@@ -293,8 +293,7 @@ sql_conn(struct options * my_opts)
293293

294294
if (PQstatus(conn) == CONNECTION_BAD &&
295295
PQconnectionNeedsPassword(conn) &&
296-
password == NULL &&
297-
!feof(stdin))
296+
password == NULL)
298297
{
299298
PQfinish(conn);
300299
password = simple_prompt("Password: ", 100, false);

contrib/pgbench/pgbench.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* A simple benchmark program for PostgreSQL
55
* Originally written by Tatsuo Ishii and enhanced by many contributors.
66
*
7-
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.83 2009/01/01 17:23:32 momjian Exp $
7+
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.84 2009/02/25 13:24:40 petere Exp $
88
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
99
* ALL RIGHTS RESERVED;
1010
*
@@ -309,8 +309,7 @@ doConnect(void)
309309

310310
if (PQstatus(conn) == CONNECTION_BAD &&
311311
PQconnectionNeedsPassword(conn) &&
312-
password == NULL &&
313-
!feof(stdin))
312+
password == NULL)
314313
{
315314
PQfinish(conn);
316315
password = simple_prompt("Password: ", 100, false);

contrib/vacuumlo/vacuumlo.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/contrib/vacuumlo/vacuumlo.c,v 1.37 2009/01/01 17:23:32 momjian Exp $
11+
* $PostgreSQL: pgsql/contrib/vacuumlo/vacuumlo.c,v 1.38 2009/02/25 13:24:40 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -91,8 +91,7 @@ vacuumlo(char *database, struct _param * param)
9191

9292
if (PQstatus(conn) == CONNECTION_BAD &&
9393
PQconnectionNeedsPassword(conn) &&
94-
password == NULL &&
95-
!feof(stdin))
94+
password == NULL)
9695
{
9796
PQfinish(conn);
9897
password = simple_prompt("Password: ", 100, false);

src/bin/pg_dump/pg_backup_db.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Implements the basic DB functions used by the archiver.
66
*
77
* IDENTIFICATION
8-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.81 2009/02/02 20:07:37 adunstan Exp $
8+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.82 2009/02/25 13:24:40 petere Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -241,8 +241,7 @@ ConnectDatabase(Archive *AHX,
241241

242242
if (PQstatus(AH->connection) == CONNECTION_BAD &&
243243
PQconnectionNeedsPassword(AH->connection) &&
244-
password == NULL &&
245-
!feof(stdin))
244+
password == NULL)
246245
{
247246
PQfinish(AH->connection);
248247
password = simple_prompt("Password: ", 100, false);

src/bin/pg_dump/pg_dumpall.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
88
*
9-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.116 2009/02/25 13:03:06 petere Exp $
9+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.117 2009/02/25 13:24:40 petere Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -1358,8 +1358,7 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport,
13581358

13591359
if (PQstatus(conn) == CONNECTION_BAD &&
13601360
PQconnectionNeedsPassword(conn) &&
1361-
password == NULL &&
1362-
!feof(stdin))
1361+
password == NULL)
13631362
{
13641363
PQfinish(conn);
13651364
password = simple_prompt("Password: ", 100, false);

src/bin/psql/startup.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.153 2009/01/01 17:23:55 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.154 2009/02/25 13:24:40 petere Exp $
77
*/
88
#include "postgres_fe.h"
99

@@ -189,8 +189,7 @@ main(int argc, char *argv[])
189189

190190
if (PQstatus(pset.db) == CONNECTION_BAD &&
191191
PQconnectionNeedsPassword(pset.db) &&
192-
password == NULL &&
193-
!feof(stdin))
192+
password == NULL)
194193
{
195194
PQfinish(pset.db);
196195
password = simple_prompt(password_prompt, 100, false);

src/bin/scripts/common.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.33 2009/01/01 17:23:55 momjian Exp $
10+
* $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.34 2009/02/25 13:24:40 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -124,8 +124,7 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport,
124124

125125
if (PQstatus(conn) == CONNECTION_BAD &&
126126
PQconnectionNeedsPassword(conn) &&
127-
password == NULL &&
128-
!feof(stdin))
127+
password == NULL)
129128
{
130129
PQfinish(conn);
131130
password = simple_prompt("Password: ", 100, false);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/tonybelloni/postgres/commit/a3c502c89f624aed5ee9f6e896740f86a28cc50e

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy