From 3df26622d9fcf254cdc4ea5a91055ca9631cf017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Sun, 29 Mar 2020 18:02:01 +0200 Subject: [PATCH] Fixing a crashing bug when enabling LDAP plugin Bug introduced in 238aeb87980dca494f5a080a886f72e8acbe1e20 --- src/main.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 005c3fd77..9063ab379 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1252,9 +1252,14 @@ static void LoadPlugins() { exit(EXIT_FAILURE); } else { GloMyLdapAuth = create_MySQL_LDAP_Authentication(); - if (GloMyLdapAuth) { - GloAdmin->init_ldap(); - GloAdmin->load_ldap_variables_to_runtime(); + // we are removing this from here, and copying in + // ProxySQL_Main_init_phase2___not_started + // the keep record of these two lines to make sure we don't + // do a similar mistakes with other plugins + // + //if (GloMyLdapAuth) { + // GloAdmin->init_ldap(); + // GloAdmin->load_ldap_variables_to_runtime(); } } } @@ -1265,6 +1270,9 @@ static void LoadPlugins() { void ProxySQL_Main_init_phase2___not_started() { LoadPlugins(); + GloAdmin->init_ldap(); + GloAdmin->load_ldap_variables_to_runtime(); + ProxySQL_Main_init_main_modules(); ProxySQL_Main_init_Admin_module(); GloMTH->print_version(); @@ -1281,6 +1289,10 @@ void ProxySQL_Main_init_phase2___not_started() { GloVars.confFile->CloseFile(); } + if (GloMyLdapAuth) { + GloAdmin->init_ldap(); + GloAdmin->load_ldap_variables_to_runtime(); + } ProxySQL_Main_init_Auth_module();