Skip to content

Commit a54ea1f

Browse files
committed
Comment out check for substitution of private key file on Windows,
since st_ino can't be trusted on that platform. Per report from T.J.
1 parent 8e4f407 commit a54ea1f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/interfaces/libpq/fe-secure.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.66 2005/01/08 22:51:15 tgl Exp $
14+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.67 2005/01/10 00:37:12 tgl Exp $
1515
*
1616
* NOTES
1717
* [ Most of these notes are wrong/obsolete, but perhaps not all ]
@@ -768,8 +768,10 @@ static int
768768
client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
769769
{
770770
char homedir[MAXPGPATH];
771-
struct stat buf,
772-
buf2;
771+
struct stat buf;
772+
#ifndef WIN32
773+
struct stat buf2;
774+
#endif
773775
char fnbuf[MAXPGPATH];
774776
FILE *fp;
775777
PGconn *conn = (PGconn *) SSL_get_app_data(ssl);
@@ -831,13 +833,15 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
831833
fnbuf, pqStrerror(errno, sebuf, sizeof(sebuf)));
832834
return 0;
833835
}
836+
#ifndef WIN32
834837
if (fstat(fileno(fp), &buf2) == -1 ||
835838
buf.st_dev != buf2.st_dev || buf.st_ino != buf2.st_ino)
836839
{
837840
printfPQExpBuffer(&conn->errorMessage,
838841
libpq_gettext("private key file \"%s\" changed during execution\n"), fnbuf);
839842
return 0;
840843
}
844+
#endif
841845
if (PEM_read_PrivateKey(fp, pkey, cb, NULL) == NULL)
842846
{
843847
char *err = SSLerrmessage();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy