Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit538724f

Browse files
Extend the private key stat checking error handling
If the stat operation on the private key failed, the code assumed itwas due to an ENOENT, which may or may not be true. Extend the checkby printing a different error message on non-ENOENT errors for easierdebugging.Per suggestion by Tom Lane due to an issue with the fairywren animalin the buildfarm.Discussion:https://postgr.es/m/1632478.1638305700@sss.pgh.pa.us
1 parentb637101 commit538724f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎src/interfaces/libpq/fe-secure-openssl.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,9 +1235,14 @@ initialize_SSL(PGconn *conn)
12351235

12361236
if (stat(fnbuf,&buf)!=0)
12371237
{
1238-
appendPQExpBuffer(&conn->errorMessage,
1239-
libpq_gettext("certificate present, but not private key file \"%s\"\n"),
1240-
fnbuf);
1238+
if (errno==ENOENT)
1239+
appendPQExpBuffer(&conn->errorMessage,
1240+
libpq_gettext("certificate present, but not private key file \"%s\"\n"),
1241+
fnbuf);
1242+
else
1243+
appendPQExpBuffer(&conn->errorMessage,
1244+
libpq_gettext("could not stat private key file \"%s\": %m\n"),
1245+
fnbuf);
12411246
return-1;
12421247
}
12431248
#ifndefWIN32

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp