Skip to content

Commit a672e96

Browse files
committed
Prompt username/password on stderr so:
pg_dump -o -u some_db >dump_file works.
1 parent e6487cc commit a672e96

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*
2323
*
2424
* IDENTIFICATION
25-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.149 2000/06/02 15:57:38 momjian Exp $
25+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.150 2000/06/09 12:33:42 momjian Exp $
2626
*
2727
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
2828
*
@@ -490,11 +490,9 @@ prompt_for_password(char *username, char *password)
490490

491491
#ifdef HAVE_TERMIOS_H
492492
struct termios t_orig,
493-
t;
494-
495493
#endif
496494

497-
printf("Username: ");
495+
fprintf(stderr, "Username: ");
498496
fgets(username, 100, stdin);
499497
length = strlen(username);
500498
/* skip rest of the line */
@@ -508,7 +506,7 @@ prompt_for_password(char *username, char *password)
508506
if (length > 0 && username[length - 1] == '\n')
509507
username[length - 1] = '\0';
510508

511-
printf("Password: ");
509+
fprintf(stderr, "Password: ");
512510
#ifdef HAVE_TERMIOS_H
513511
tcgetattr(0, &t);
514512
t_orig = t;
@@ -532,7 +530,7 @@ prompt_for_password(char *username, char *password)
532530
if (length > 0 && password[length - 1] == '\n')
533531
password[length - 1] = '\0';
534532

535-
printf("\n\n");
533+
fprintf(stderr, "\n\n");
536534
}
537535

538536

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy