Skip to content

Commit fc22db8

Browse files
committed
Bug#35828929 ndb_mgm_listen_event() does not support TLS
The public MGMAPI function ndb_mgm_listen_event can not be used for reading events if management connection uses TLS. Users should if they need consider to use the binary ndb_logevent API instead. Test programs are changed to use the internal ndb_mgm_listen_event_internal instead to support TLS connections. Change-Id: I2c1b2bfad5bd62584cb575a2df6bd5e1ce9b3a83
1 parent 9fdb671 commit fc22db8

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

storage/ndb/include/mgmapi/mgmapi.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,10 @@ struct ssl_ctx_st;
11701170
* pushed to fd, level=0 ends list.
11711171
*
11721172
* @return fd filedescriptor to read events from
1173+
*
1174+
* Note, events can not be read using this socket if management handle uses
1175+
* TLS. Consider to use the binary logevent interface instead, see below
1176+
* ndb_mgm_create_logevent_handle and ndb_logevent-functions.
11731177
*/
11741178
#ifdef _WIN32
11751179
SOCKET ndb_mgm_listen_event(NdbMgmHandle handle, const int filter[]);

storage/ndb/test/include/NdbMgmd.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,8 @@ class NdbMgmd {
463463
0
464464
};
465465

466-
m_event_socket = ndb_socket_create_from_native(
467-
ndb_mgm_listen_event(m_handle, filter));
466+
m_event_socket =
467+
ndb_mgm_listen_event_internal(m_handle, filter, 0, true);
468468

469469
return m_event_socket.is_valid();
470470
}

storage/ndb/test/ndbapi/testLcp.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include <HugoTransactions.hpp>
3131
#include <UtilTransactions.hpp>
3232
#include <signaldata/DumpStateOrd.hpp>
33-
33+
#include "mgmapi_internal.h"
3434
#include <getarg.h>
3535
#include <InputStream.hpp>
3636

@@ -386,8 +386,8 @@ static int pause_lcp(int error)
386386

387387
int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_INFO, 0 };
388388

389-
NdbSocket my_fd{ndb_socket_create_from_native(
390-
ndb_mgm_listen_event(g_restarter.handle, filter))};
389+
NdbSocket my_fd =
390+
ndb_mgm_listen_event_internal(g_restarter.handle, filter, 0, true);
391391

392392
require(my_fd.is_valid());
393393
require(!g_restarter.insertErrorInAllNodes(error));
@@ -482,8 +482,8 @@ static int continue_lcp(int error)
482482
NdbSocket my_fd;
483483

484484
if(error){
485-
my_fd = ndb_socket_create_from_native(
486-
ndb_mgm_listen_event(g_restarter.handle, filter));
485+
my_fd =
486+
ndb_mgm_listen_event_internal(g_restarter.handle, filter, 0, true);
487487
require(my_fd.is_valid());
488488
}
489489

storage/ndb/test/ndbapi/testMgm.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,7 @@ int runTestMgmApiEventTimeout(NDBT_Context* ctx, NDBT_Step* step)
507507
1, NDB_MGM_EVENT_CATEGORY_STARTUP,
508508
0 };
509509

510-
NdbSocket my_fd{ndb_socket_create_from_native(
511-
ndb_mgm_listen_event(h, filter))};
510+
NdbSocket my_fd = ndb_mgm_listen_event_internal(h, filter, 0, true);
512511

513512
if(!my_fd.is_valid())
514513
{

storage/ndb/test/ndbapi/test_event.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6152,8 +6152,8 @@ int runGetLogEventPretty(NDBT_Context* ctx, NDBT_Step* step)
61526152
return NDBT_FAILED;
61536153

61546154
int filter[] = {15, NDB_MGM_EVENT_CATEGORY_INFO, 0};
6155-
NdbSocket my_fd{ndb_socket_create_from_native(
6156-
ndb_mgm_listen_event(mgmd.handle(), filter))};
6155+
NdbSocket my_fd =
6156+
ndb_mgm_listen_event_internal(mgmd.handle(), filter, 0, true);
61576157

61586158
if(!my_fd.is_valid())
61596159
{

0 commit comments

Comments
 (0)