|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.345 2007/03/08 19:27:28 mha Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.346 2007/07/08 17:11:51 joe Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -1641,6 +1641,10 @@ PQconnectPoll(PGconn *conn)
|
1641 | 1641 | return PGRES_POLLING_READING;
|
1642 | 1642 | }
|
1643 | 1643 |
|
| 1644 | + /* save the authentication request type */ |
| 1645 | + if (conn->areq == AUTH_REQ_UNK) |
| 1646 | + conn->areq = areq; |
| 1647 | + |
1644 | 1648 | /* Get the password salt if there is one. */
|
1645 | 1649 | if (areq == AUTH_REQ_MD5)
|
1646 | 1650 | {
|
@@ -1873,6 +1877,7 @@ makeEmptyPGconn(void)
|
1873 | 1877 | conn->std_strings = false; /* unless server says differently */
|
1874 | 1878 | conn->verbosity = PQERRORS_DEFAULT;
|
1875 | 1879 | conn->sock = -1;
|
| 1880 | + conn->areq = AUTH_REQ_UNK; |
1876 | 1881 | #ifdef USE_SSL
|
1877 | 1882 | conn->allow_ssl_try = true;
|
1878 | 1883 | conn->wait_ssl_try = false;
|
@@ -3441,6 +3446,17 @@ PQsetClientEncoding(PGconn *conn, const char *encoding)
|
3441 | 3446 | return status;
|
3442 | 3447 | }
|
3443 | 3448 |
|
| 3449 | +bool |
| 3450 | +PQconnectionUsedPassword(const PGconn *conn) |
| 3451 | +{ |
| 3452 | + if (conn->areq == AUTH_REQ_MD5 || |
| 3453 | + conn->areq == AUTH_REQ_CRYPT || |
| 3454 | + conn->areq == AUTH_REQ_PASSWORD) |
| 3455 | + return true; |
| 3456 | + else |
| 3457 | + return false; |
| 3458 | +} |
| 3459 | + |
3444 | 3460 | PGVerbosity
|
3445 | 3461 | PQsetErrorVerbosity(PGconn *conn, PGVerbosity verbosity)
|
3446 | 3462 | {
|
|
0 commit comments