Quote filename in error message
authorDaniel Gustafsson <[email protected]>
Sat, 5 Apr 2025 20:10:28 +0000 (22:10 +0200)
committerDaniel Gustafsson <[email protected]>
Sat, 5 Apr 2025 20:10:28 +0000 (22:10 +0200)
Project standard is to quote filenames in error and log messages, which
commit 2da74d8d640 missed in two error messages.

Author: Kyotaro Horiguchi <[email protected]>
Reported-by: Kyotaro Horiguchi <[email protected]>
Reviewed-by: Daniel Gustafsson <[email protected]>
Discussion: https://postgr.es/m/20250404.120328.103562371975971823[email protected]

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

index 4bfd8e0447ce9f017a1900a4dd2a3e13a0ab465d..78f9e84eb353ba4f8e2ff8cfb05796747794e462 100644 (file)
@@ -711,7 +711,7 @@ SSL_CTX_keylog_cb(const SSL *ssl, const char *line)
 
    if (fd == -1)
    {
-       libpq_append_conn_error(conn, "could not open ssl keylog file %s: %s",
+       libpq_append_conn_error(conn, "could not open ssl keylog file \"%s\": %s",
                                conn->sslkeylogfile, pg_strerror(errno));
        return;
    }
@@ -719,7 +719,7 @@ SSL_CTX_keylog_cb(const SSL *ssl, const char *line)
    /* line is guaranteed by OpenSSL to be NUL terminated */
    rc = write(fd, line, strlen(line));
    if (rc < 0)
-       libpq_append_conn_error(conn, "could not write to ssl keylog file %s: %s",
+       libpq_append_conn_error(conn, "could not write to ssl keylog file \"%s\": %s",
                                conn->sslkeylogfile, pg_strerror(errno));
    else
        rc = write(fd, "\n", 1);