mirror of
https://github.com/postgres/postgres.git
synced 2025-08-08 06:02:22 +03:00
pg_password utility. Cleanup for psql passwords. New datetime contrib stuff for new version. Fix for strutils needing config.h.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
@@ -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
|
||||
#
|
||||
|
@@ -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");
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user