Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file descriptor leak introduced in x509 cache #4272 #4307

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deps/mariadb-client-library/openssl.c.sslkeylogfile.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@@ -526,12 +526,19 @@
@@ -529,12 +529,19 @@
memset(buf, 0, size);
if (userdata)
strncpy(buf, (char *)userdata, size);
Expand All @@ -18,7 +18,7 @@
char *certfile= mysql->options.ssl_cert,
*keyfile= mysql->options.ssl_key;
char *pw= (mysql->options.extension) ?
@@ -653,12 +660,13 @@
@@ -656,12 +663,13 @@
if (!(ctx= SSL_CTX_new(SSLv23_client_method())))
#endif
goto error;
Expand Down
11 changes: 7 additions & 4 deletions deps/mariadb-client-library/openssl.c.x509cache.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#if defined(_WIN32) && !defined(_OPENSSL_Applink) && defined(HAVE_OPENSSL_APPLINK_C)
#include <openssl/applink.c>
#endif
@@ -73,6 +79,81 @@
@@ -73,6 +79,84 @@
extern my_bool ma_tls_initialized;
extern unsigned int mariadb_deinitialize_ssl;

Expand Down Expand Up @@ -42,10 +42,13 @@
+ sprintf((char*)&(file_sha1[i*2]), "%02x", temp[i]);
+ }
+ munmap(fb,statbuf.st_size);
+ close(fd);
+ } else {
+ close(fd);
+ return 0;
+ }
+ } else {
+ close(fd);
+ return 0;
+ }
+
Expand Down Expand Up @@ -93,7 +96,7 @@
#define MAX_SSL_ERR_LEN 100
char tls_library_version[TLS_VERSION_LENGTH];

@@ -456,7 +537,7 @@
@@ -456,7 +540,7 @@
char *pw= (mysql->options.extension) ?
mysql->options.extension->tls_pw : NULL;
SSL_CTX *ctx= SSL_get_SSL_CTX(ssl);
Expand All @@ -102,7 +105,7 @@

/* add cipher */
if ((mysql->options.ssl_cipher &&
@@ -467,16 +548,32 @@
@@ -467,16 +551,32 @@
}

/* ca_file and ca_path */
Expand Down Expand Up @@ -139,7 +142,7 @@
if (keyfile && !certfile)
certfile= keyfile;
if (certfile && !keyfile)
@@ -566,6 +663,8 @@
@@ -566,6 +666,8 @@
SSL_CTX_sess_set_remove_cb(ctx, ma_tls_remove_session_cb);
#endif

Expand Down
Loading