1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-21 00:42:43 +03:00

Arrange for the authentication request type to be preserved in

PGconn. Invent a new libpq connection-status function,
PQconnectionUsedPassword() that returns true if the server
demanded a password during authentication, false otherwise.
This may be useful to clients in general, but is immediately
useful to help plug a privilege escalation path in dblink.
Per list discussion and design proposed by Tom Lane.
This commit is contained in:
Joe Conway
2007-07-08 17:11:51 +00:00
parent 8c69d881ce
commit 51bc3dfe4b
6 changed files with 42 additions and 7 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/interfaces/libpq/libpq-fe.h,v 1.136 2007/03/03 19:52:46 momjian Exp $
* $PostgreSQL: pgsql/src/interfaces/libpq/libpq-fe.h,v 1.137 2007/07/08 17:11:51 joe Exp $
*
*-------------------------------------------------------------------------
*/
@@ -23,10 +23,11 @@ extern "C"
#include <stdio.h>
/*
* postgres_ext.h defines the backend's externally visible types,
* defines the backend's externally visible types,
* such as Oid.
*/
#include "postgres_ext.h"
#include "postgres_fe.h"
/* Application-visible enum types */
@@ -265,6 +266,7 @@ extern int PQsocket(const PGconn *conn);
extern int PQbackendPID(const PGconn *conn);
extern int PQclientEncoding(const PGconn *conn);
extern int PQsetClientEncoding(PGconn *conn, const char *encoding);
extern bool PQconnectionUsedPassword(const PGconn *conn);
/* Get the OpenSSL structure associated with a connection. Returns NULL for
* unencrypted connections or if any other TLS library is in use. */