diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/libpq/password.c | 3 | ||||
-rw-r--r-- | src/bin/Makefile | 3 | ||||
-rw-r--r-- | src/bin/psql/psql.c | 20 | ||||
-rw-r--r-- | src/bin/psql/stringutils.c | 3 |
4 files changed, 23 insertions, 6 deletions
diff --git a/src/backend/libpq/password.c b/src/backend/libpq/password.c index afbd95ad1ae..346d59e8bf6 100644 --- a/src/backend/libpq/password.c +++ b/src/backend/libpq/password.c @@ -79,7 +79,8 @@ verify_password(char *user, char *password, Port *port, } /* kill the newline */ - test_pw[strlen(test_pw)-1] = '\0'; + if (test_pw[strlen(test_pw)-1] == '\n') + test_pw[strlen(test_pw)-1] = '\0'; strNcpy(salt, test_pw, 2); diff --git a/src/bin/Makefile b/src/bin/Makefile index a37cadee568..ecf926c6fc9 100644 --- a/src/bin/Makefile +++ b/src/bin/Makefile @@ -7,7 +7,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.7 1997/04/26 05:04:21 scrappy Exp $ +# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.8 1997/08/25 19:41:39 momjian Exp $ # #------------------------------------------------------------------------- @@ -21,6 +21,7 @@ $(MAKE) -C pg_version $@ $(MAKE) -C psql $@ $(MAKE) -C pg_dump $@ + $(MAKE) -C pg_passwd $@ # # Shell scripts # diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c index 5f8dddb8be8..62568a33811 100644 --- a/src/bin/psql/psql.c +++ b/src/bin/psql/psql.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.86 1997/08/22 04:13:18 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.87 1997/08/25 19:41:48 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1239,8 +1239,8 @@ HandleSlashCmds(PsqlSettings * settings, } else if (!optarg) { /* show tables, sequences and indices */ tableList(settings, 0, 'b'); } else if (strcmp(optarg, "*") == 0) { /* show everything */ - tableList(settings, 0, 'b'); - tableList(settings, 1, 'b'); + if (tableList(settings, 0, 'b') == 0) + tableList(settings, 1, 'b'); } else { /* describe the specified table */ tableDesc(settings, optarg); } @@ -1945,6 +1945,13 @@ static void prompt_for_password(char *username, char *password) printf("Username: "); fgets(username, 9, stdin); length = strlen(username); + /* skip rest of the line */ + if (length > 0 && username[length-1] != '\n') { + static char buf[512]; + do { + fgets(buf, 512, stdin); + } while (buf[strlen(buf)-1] != '\n'); + } if(length > 0 && username[length-1] == '\n') username[length-1] = '\0'; printf("Password: "); @@ -1960,6 +1967,13 @@ static void prompt_for_password(char *username, char *password) #endif length = strlen(password); + /* skip rest of the line */ + if (length > 0 && password[length-1] != '\n') { + static char buf[512]; + do { + fgets(buf, 512, stdin); + } while (buf[strlen(buf)-1] != '\n'); + } if(length > 0 && password[length-1] == '\n') password[length-1] = '\0'; printf("\n\n"); diff --git a/src/bin/psql/stringutils.c b/src/bin/psql/stringutils.c index 6237aa5e301..cae0e7405be 100644 --- a/src/bin/psql/stringutils.c +++ b/src/bin/psql/stringutils.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.9 1997/08/19 21:36:56 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.10 1997/08/25 19:41:52 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -16,6 +16,7 @@ #include <ctype.h> #include <stdlib.h> +#include "postgres.h" #ifndef HAVE_STRDUP #include "strdup.h" #endif |