aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-auth.c
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2008-10-28 12:10:44 +0000
committerMagnus Hagander <magnus@hagander.net>2008-10-28 12:10:44 +0000
commit53a5026b5cb359ec31e81fa6b20a69b053b87569 (patch)
treef0c3debd1187d1ff69ae6cb4a2d6604d75cdda0d /src/interfaces/libpq/fe-auth.c
parentba4eb01554fa02268823234983200a71b3b77c1b (diff)
downloadpostgresql-53a5026b5cb359ec31e81fa6b20a69b053b87569.tar.gz
postgresql-53a5026b5cb359ec31e81fa6b20a69b053b87569.zip
Remove support for (insecure) crypt authentication.
This breaks compatibility with pre-7.2 versions.
Diffstat (limited to 'src/interfaces/libpq/fe-auth.c')
-rw-r--r--src/interfaces/libpq/fe-auth.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/interfaces/libpq/fe-auth.c b/src/interfaces/libpq/fe-auth.c
index f0d79487129..64631966489 100644
--- a/src/interfaces/libpq/fe-auth.c
+++ b/src/interfaces/libpq/fe-auth.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.137 2008/01/31 18:58:30 tgl Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.138 2008/10/28 12:10:44 mha Exp $
*
*-------------------------------------------------------------------------
*/
@@ -40,10 +40,6 @@
#include <pwd.h>
#endif
-#ifdef HAVE_CRYPT_H
-#include <crypt.h>
-#endif
-
#include "libpq-fe.h"
#include "fe-auth.h"
#include "libpq/md5.h"
@@ -787,14 +783,6 @@ pg_password_sendauth(PGconn *conn, const char *password, AuthRequest areq)
}
break;
}
- case AUTH_REQ_CRYPT:
- {
- char salt[3];
-
- strlcpy(salt, conn->cryptSalt, sizeof(salt));
- crypt_pwd = crypt(password, salt);
- break;
- }
case AUTH_REQ_PASSWORD:
/* discard const so we can assign it */
crypt_pwd = (char *) password;
@@ -938,8 +926,12 @@ pg_fe_sendauth(AuthRequest areq, PGconn *conn)
#endif
- case AUTH_REQ_MD5:
case AUTH_REQ_CRYPT:
+ printfPQExpBuffer(&conn->errorMessage,
+ libpq_gettext("Crypt authentication not supported\n"));
+ return STATUS_ERROR;
+
+ case AUTH_REQ_MD5:
case AUTH_REQ_PASSWORD:
conn->password_needed = true;
if (conn->pgpass == NULL || conn->pgpass[0] == '\0')