-
- Downloads
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.
Showing
- src/backend/libpq/Makefile 3 additions, 2 deletionssrc/backend/libpq/Makefile
- src/backend/libpq/auth.c 42 additions, 5 deletionssrc/backend/libpq/auth.c
- src/backend/libpq/hba.c 45 additions, 55 deletionssrc/backend/libpq/hba.c
- src/backend/libpq/pqcomm.c 27 additions, 1 deletionsrc/backend/libpq/pqcomm.c
- src/backend/postmaster/postmaster.c 3 additions, 3 deletionssrc/backend/postmaster/postmaster.c
- src/bin/psql/psql.c 117 additions, 3 deletionssrc/bin/psql/psql.c
- src/include/config.h.in 5 additions, 2 deletionssrc/include/config.h.in
- src/include/libpq/hba.h 31 additions, 1 deletionsrc/include/libpq/hba.h
- src/include/libpq/pqcomm.h 8 additions, 3 deletionssrc/include/libpq/pqcomm.h
- src/interfaces/libpq/fe-auth.c 25 additions, 3 deletionssrc/interfaces/libpq/fe-auth.c
- src/interfaces/libpq/fe-auth.h 4 additions, 2 deletionssrc/interfaces/libpq/fe-auth.h
- src/interfaces/libpq/fe-connect.c 32 additions, 4 deletionssrc/interfaces/libpq/fe-connect.c
- src/interfaces/libpq/libpq-fe.h 3 additions, 1 deletionsrc/interfaces/libpq/libpq-fe.h
Loading
Please register or sign in to comment