mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] password authentication This patch adds support for plaintext password authentication. To use it, you add a line like host all 0.0.0.0 0.0.0.0 password pg_pwd.conf to your pg_hba.conf, where 'pg_pwd.conf' is the name of a file containing the usernames and password hashes in the format of the first two fields of a Unix /etc/passwd file. (Of course, you can use a specific database name or IP instead.) Then, to connect with a password through libpq, you use the PQconnectdb() function, specifying the "password=" tag in the connect string and also adding the tag "authtype=password". I also added a command-line switch '-u' to psql that tells it to prompt for a username and password and use password authentication.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.43 1997/03/02 02:17:32 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.44 1997/03/12 21:18:38 scrappy Exp $
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
@@ -660,8 +660,8 @@ ConnStartup(Port *port, int *status,
|
||||
char buffer[200 + sizeof(namebuf)];
|
||||
sprintf(buffer,
|
||||
"Failed to authenticate client as Postgres user '%s' "
|
||||
"using authentication scheme %d.",
|
||||
namebuf, msgType);
|
||||
"using %s: %s",
|
||||
namebuf, name_of_authentication_type(msgType), PQerrormsg);
|
||||
strncpy(errormsg, buffer, errormsg_len);
|
||||
*status = STATUS_ERROR;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user