diff --git a/server/core/load_utils.cc b/server/core/load_utils.cc index 0ea413225..b313d68a9 100644 --- a/server/core/load_utils.cc +++ b/server/core/load_utils.cc @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -139,9 +140,14 @@ void *load_module(const char *module, const char *type) if ((mod = find_module(module)) == NULL) { + size_t len = strlen(module); + char lc_module[len + 1]; + lc_module[len] = 0; + std::transform(module, module + len, lc_module, tolower); + /** The module is not already loaded, search for the shared object */ char fname[MAXPATHLEN + 1]; - snprintf(fname, MAXPATHLEN + 1, "%s/lib%s.so", get_libdir(), module); + snprintf(fname, MAXPATHLEN + 1, "%s/lib%s.so", get_libdir(), lc_module); if (access(fname, F_OK) == -1) { @@ -219,7 +225,7 @@ find_module(const char *module) { while (mod) { - if (strcmp(mod->module, module) == 0) + if (strcasecmp(mod->module, module) == 0) { return mod; } diff --git a/server/core/modulecmd.cc b/server/core/modulecmd.cc index 68290fb3f..717fd19e1 100644 --- a/server/core/modulecmd.cc +++ b/server/core/modulecmd.cc @@ -323,7 +323,7 @@ static bool process_argument(const MODULECMD *cmd, modulecmd_arg_type_t *type, c if ((arg->value.monitor = monitor_find((char*)value))) { const char* eff_name = mxs_module_get_effective_name(arg->value.monitor->module_name); - if (MODULECMD_ALLOW_NAME_MISMATCH(type) || strcmp(cmd->domain, eff_name) == 0) + if (MODULECMD_ALLOW_NAME_MISMATCH(type) || strcasecmp(cmd->domain, eff_name) == 0) { arg->type.type = MODULECMD_ARG_MONITOR; rval = true; @@ -343,7 +343,7 @@ static bool process_argument(const MODULECMD *cmd, modulecmd_arg_type_t *type, c if ((arg->value.filter = filter_def_find((char*)value))) { const char* eff_name = mxs_module_get_effective_name(arg->value.filter->module); - if (MODULECMD_ALLOW_NAME_MISMATCH(type) || strcmp(cmd->domain, eff_name) == 0) + if (MODULECMD_ALLOW_NAME_MISMATCH(type) || strcasecmp(cmd->domain, eff_name) == 0) { arg->type.type = MODULECMD_ARG_FILTER; rval = true; diff --git a/server/modules/authenticator/CDCPlainAuth/CMakeLists.txt b/server/modules/authenticator/CDCPlainAuth/CMakeLists.txt index f729f9979..457c87044 100644 --- a/server/modules/authenticator/CDCPlainAuth/CMakeLists.txt +++ b/server/modules/authenticator/CDCPlainAuth/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(CDCPlainAuth SHARED cdc_plain_auth.c) -target_link_libraries(CDCPlainAuth maxscale-common) -set_target_properties(CDCPlainAuth PROPERTIES VERSION "1.0.0") -install_module(CDCPlainAuth core) +add_library(cdcplainauth SHARED cdc_plain_auth.c) +target_link_libraries(cdcplainauth maxscale-common) +set_target_properties(cdcplainauth PROPERTIES VERSION "1.0.0") +install_module(cdcplainauth core) diff --git a/server/modules/authenticator/GSSAPI/GSSAPIAuth/CMakeLists.txt b/server/modules/authenticator/GSSAPI/GSSAPIAuth/CMakeLists.txt index 7dd3034a9..a94d9d8f5 100644 --- a/server/modules/authenticator/GSSAPI/GSSAPIAuth/CMakeLists.txt +++ b/server/modules/authenticator/GSSAPI/GSSAPIAuth/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(GSSAPIAuth SHARED gssapi_auth.c ../gssapi_auth_common.c) -target_link_libraries(GSSAPIAuth maxscale-common ${GSSAPI_LIBS} ${SQLITE_LIBRARIES} MySQLCommon) -set_target_properties(GSSAPIAuth PROPERTIES VERSION "1.0.0") -install_module(GSSAPIAuth core) +add_library(gssapiauth SHARED gssapi_auth.c ../gssapi_auth_common.c) +target_link_libraries(gssapiauth maxscale-common ${GSSAPI_LIBS} ${SQLITE_LIBRARIES} mysqlcommon) +set_target_properties(gssapiauth PROPERTIES VERSION "1.0.0") +install_module(gssapiauth core) diff --git a/server/modules/authenticator/GSSAPI/GSSAPIBackendAuth/CMakeLists.txt b/server/modules/authenticator/GSSAPI/GSSAPIBackendAuth/CMakeLists.txt index fc61e8e9d..98b1a81e0 100644 --- a/server/modules/authenticator/GSSAPI/GSSAPIBackendAuth/CMakeLists.txt +++ b/server/modules/authenticator/GSSAPI/GSSAPIBackendAuth/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(GSSAPIBackendAuth SHARED gssapi_backend_auth.c ../gssapi_auth_common.c) -target_link_libraries(GSSAPIBackendAuth maxscale-common ${GSSAPI_LIBS} MySQLCommon) -set_target_properties(GSSAPIBackendAuth PROPERTIES VERSION "1.0.0") -install_module(GSSAPIBackendAuth core) +add_library(gssapibackendauth SHARED gssapi_backend_auth.c ../gssapi_auth_common.c) +target_link_libraries(gssapibackendauth maxscale-common ${GSSAPI_LIBS} mysqlcommon) +set_target_properties(gssapibackendauth PROPERTIES VERSION "1.0.0") +install_module(gssapibackendauth core) diff --git a/server/modules/authenticator/HTTPAuth/CMakeLists.txt b/server/modules/authenticator/HTTPAuth/CMakeLists.txt index 31e72afac..8bfcfe844 100644 --- a/server/modules/authenticator/HTTPAuth/CMakeLists.txt +++ b/server/modules/authenticator/HTTPAuth/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(HTTPAuth SHARED http_auth.c) -target_link_libraries(HTTPAuth maxscale-common) -set_target_properties(HTTPAuth PROPERTIES VERSION "1.0.0") -install_module(HTTPAuth core) +add_library(httpauth SHARED http_auth.c) +target_link_libraries(httpauth maxscale-common) +set_target_properties(httpauth PROPERTIES VERSION "1.0.0") +install_module(httpauth core) diff --git a/server/modules/authenticator/MaxAdminAuth/CMakeLists.txt b/server/modules/authenticator/MaxAdminAuth/CMakeLists.txt index 7de926fb2..6ea6328dc 100644 --- a/server/modules/authenticator/MaxAdminAuth/CMakeLists.txt +++ b/server/modules/authenticator/MaxAdminAuth/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(MaxAdminAuth SHARED max_admin_auth.c) -target_link_libraries(MaxAdminAuth maxscale-common) -set_target_properties(MaxAdminAuth PROPERTIES VERSION "1.0.0") -install_module(MaxAdminAuth core) +add_library(maxadminauth SHARED max_admin_auth.c) +target_link_libraries(maxadminauth maxscale-common) +set_target_properties(maxadminauth PROPERTIES VERSION "1.0.0") +install_module(maxadminauth core) diff --git a/server/modules/authenticator/MySQLAuth/CMakeLists.txt b/server/modules/authenticator/MySQLAuth/CMakeLists.txt index 9828e34b6..a4aa424f1 100644 --- a/server/modules/authenticator/MySQLAuth/CMakeLists.txt +++ b/server/modules/authenticator/MySQLAuth/CMakeLists.txt @@ -1,8 +1,8 @@ if(SQLITE_VERSION VERSION_LESS 3.3) message(FATAL_ERROR "SQLite version 3.3 or higher is required") else() - add_library(MySQLAuth SHARED mysql_auth.c dbusers.c) - target_link_libraries(MySQLAuth maxscale-common MySQLCommon sqlite3) - set_target_properties(MySQLAuth PROPERTIES VERSION "1.0.0") - install_module(MySQLAuth core) + add_library(mysqlauth SHARED mysql_auth.c dbusers.c) + target_link_libraries(mysqlauth maxscale-common mysqlcommon sqlite3) + set_target_properties(mysqlauth PROPERTIES VERSION "1.0.0") + install_module(mysqlauth core) endif() diff --git a/server/modules/authenticator/MySQLBackendAuth/CMakeLists.txt b/server/modules/authenticator/MySQLBackendAuth/CMakeLists.txt index 65582f6ca..26880ed36 100644 --- a/server/modules/authenticator/MySQLBackendAuth/CMakeLists.txt +++ b/server/modules/authenticator/MySQLBackendAuth/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(MySQLBackendAuth SHARED mysql_backend_auth.c) -target_link_libraries(MySQLBackendAuth maxscale-common MySQLCommon) -set_target_properties(MySQLBackendAuth PROPERTIES VERSION "1.0.0") -install_module(MySQLBackendAuth core) +add_library(mysqlbackendauth SHARED mysql_backend_auth.c) +target_link_libraries(mysqlbackendauth maxscale-common mysqlcommon) +set_target_properties(mysqlbackendauth PROPERTIES VERSION "1.0.0") +install_module(mysqlbackendauth core) diff --git a/server/modules/authenticator/NullAuthAllow/CMakeLists.txt b/server/modules/authenticator/NullAuthAllow/CMakeLists.txt index 23be1cb3e..fb1ee7e2f 100644 --- a/server/modules/authenticator/NullAuthAllow/CMakeLists.txt +++ b/server/modules/authenticator/NullAuthAllow/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(NullAuthAllow SHARED null_auth_allow.c) -target_link_libraries(NullAuthAllow maxscale-common MySQLCommon) -set_target_properties(NullAuthAllow PROPERTIES VERSION "1.0.0") -install_module(NullAuthAllow core) +add_library(nullauthallow SHARED null_auth_allow.c) +target_link_libraries(nullauthallow maxscale-common mysqlcommon) +set_target_properties(nullauthallow PROPERTIES VERSION "1.0.0") +install_module(nullauthallow core) diff --git a/server/modules/authenticator/NullAuthDeny/CMakeLists.txt b/server/modules/authenticator/NullAuthDeny/CMakeLists.txt index bedb90cee..d3650588c 100644 --- a/server/modules/authenticator/NullAuthDeny/CMakeLists.txt +++ b/server/modules/authenticator/NullAuthDeny/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(NullAuthDeny SHARED null_auth_deny.c) -target_link_libraries(NullAuthDeny maxscale-common) -set_target_properties(NullAuthDeny PROPERTIES VERSION "1.0.0") -install_module(NullAuthDeny core) +add_library(nullauthdeny SHARED null_auth_deny.c) +target_link_libraries(nullauthdeny maxscale-common) +set_target_properties(nullauthdeny PROPERTIES VERSION "1.0.0") +install_module(nullauthdeny core) diff --git a/server/modules/authenticator/PAM/PAMAuth/CMakeLists.txt b/server/modules/authenticator/PAM/PAMAuth/CMakeLists.txt index 468be540b..aaf7de9ca 100644 --- a/server/modules/authenticator/PAM/PAMAuth/CMakeLists.txt +++ b/server/modules/authenticator/PAM/PAMAuth/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(PAMAuth SHARED pam_auth.cc ../pam_auth_common.cc pam_client_session.cc pam_instance.cc) -target_link_libraries(PAMAuth maxscale-common ${PAM_LIBRARIES} ${SQLITE_LIBRARIES} MySQLCommon) -set_target_properties(PAMAuth PROPERTIES VERSION "1.0.0") -install_module(PAMAuth core) +add_library(pamauth SHARED pam_auth.cc ../pam_auth_common.cc pam_client_session.cc pam_instance.cc) +target_link_libraries(pamauth maxscale-common ${PAM_LIBRARIES} ${SQLITE_LIBRARIES} mysqlcommon) +set_target_properties(pamauth PROPERTIES VERSION "1.0.0") +install_module(pamauth core) diff --git a/server/modules/authenticator/PAM/PAMBackendAuth/CMakeLists.txt b/server/modules/authenticator/PAM/PAMBackendAuth/CMakeLists.txt index fb9fb4539..c1a1b41e0 100644 --- a/server/modules/authenticator/PAM/PAMBackendAuth/CMakeLists.txt +++ b/server/modules/authenticator/PAM/PAMBackendAuth/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(PAMBackendAuth SHARED pam_backend_auth.cc ../pam_auth_common.cc pam_backend_session.cc) -target_link_libraries(PAMBackendAuth maxscale-common MySQLCommon ${SQLITE_LIBRARIES}) -set_target_properties(PAMBackendAuth PROPERTIES VERSION "1.0.0") -install_module(PAMBackendAuth core) +add_library(pambackendauth SHARED pam_backend_auth.cc ../pam_auth_common.cc pam_backend_session.cc) +target_link_libraries(pambackendauth maxscale-common mysqlcommon ${SQLITE_LIBRARIES}) +set_target_properties(pambackendauth PROPERTIES VERSION "1.0.0") +install_module(pambackendauth core) diff --git a/server/modules/filter/cache/CMakeLists.txt b/server/modules/filter/cache/CMakeLists.txt index 83a04bb9a..56b4de875 100644 --- a/server/modules/filter/cache/CMakeLists.txt +++ b/server/modules/filter/cache/CMakeLists.txt @@ -17,7 +17,7 @@ if (JANSSON_FOUND) storagefactory.cc storagereal.cc ) - target_link_libraries(cache maxscale-common ${JANSSON_LIBRARIES} MySQLCommon) + target_link_libraries(cache maxscale-common ${JANSSON_LIBRARIES} mysqlcommon) set_target_properties(cache PROPERTIES VERSION "1.0.0") set_target_properties(cache PROPERTIES LINK_FLAGS -Wl,-z,defs) install_module(cache core) diff --git a/server/modules/filter/dbfwfilter/CMakeLists.txt b/server/modules/filter/dbfwfilter/CMakeLists.txt index fe0da8da0..4d0802d31 100644 --- a/server/modules/filter/dbfwfilter/CMakeLists.txt +++ b/server/modules/filter/dbfwfilter/CMakeLists.txt @@ -12,13 +12,13 @@ if(BISON_FOUND AND FLEX_FOUND) add_dependencies(dbfwfilter-core pcre2 connector-c) add_library(dbfwfilter SHARED dbfwfilter.cc) - target_link_libraries(dbfwfilter maxscale-common MySQLCommon dbfwfilter-core) + target_link_libraries(dbfwfilter maxscale-common mysqlcommon dbfwfilter-core) set_target_properties(dbfwfilter PROPERTIES VERSION "1.0.0") install_module(dbfwfilter core) # The offline rule check utility add_executable(dbfwchk dbfw_rule_check.cc) - target_link_libraries(dbfwchk maxscale-common MySQLCommon dbfwfilter-core) + target_link_libraries(dbfwchk maxscale-common mysqlcommon dbfwfilter-core) install_executable(dbfwchk core) if(BUILD_TESTS) diff --git a/server/modules/filter/insertstream/CMakeLists.txt b/server/modules/filter/insertstream/CMakeLists.txt index 845821e8c..54dd18349 100644 --- a/server/modules/filter/insertstream/CMakeLists.txt +++ b/server/modules/filter/insertstream/CMakeLists.txt @@ -1,4 +1,4 @@ add_library(insertstream SHARED insertstream.c) -target_link_libraries(insertstream maxscale-common MySQLCommon) +target_link_libraries(insertstream maxscale-common mysqlcommon) set_target_properties(insertstream PROPERTIES VERSION "1.0.0") install_module(insertstream core) diff --git a/server/modules/filter/tee/CMakeLists.txt b/server/modules/filter/tee/CMakeLists.txt index e9ebabb27..77da7e78f 100644 --- a/server/modules/filter/tee/CMakeLists.txt +++ b/server/modules/filter/tee/CMakeLists.txt @@ -1,4 +1,4 @@ add_library(tee SHARED tee.cc teesession.cc) -target_link_libraries(tee maxscale-common MySQLCommon) +target_link_libraries(tee maxscale-common mysqlcommon) set_target_properties(tee PROPERTIES VERSION "1.0.0") install_module(tee core) diff --git a/server/modules/protocol/CDC/CMakeLists.txt b/server/modules/protocol/CDC/CMakeLists.txt index 4d6d2deb8..272891a99 100644 --- a/server/modules/protocol/CDC/CMakeLists.txt +++ b/server/modules/protocol/CDC/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(CDC SHARED cdc.c) -target_link_libraries(CDC maxscale-common) -set_target_properties(CDC PROPERTIES VERSION "1.0.1") -install_module(CDC core) +add_library(cdc SHARED cdc.c) +target_link_libraries(cdc maxscale-common) +set_target_properties(cdc PROPERTIES VERSION "1.0.1") +install_module(cdc core) diff --git a/server/modules/protocol/MySQL/CMakeLists.txt b/server/modules/protocol/MySQL/CMakeLists.txt index 24e09dcbb..75471c144 100644 --- a/server/modules/protocol/MySQL/CMakeLists.txt +++ b/server/modules/protocol/MySQL/CMakeLists.txt @@ -1,7 +1,7 @@ -add_library(MySQLCommon SHARED mysql_common.cc mariadb_client.cc) -target_link_libraries(MySQLCommon maxscale-common) -set_target_properties(MySQLCommon PROPERTIES VERSION "2.0.0") -install_module(MySQLCommon core) +add_library(mysqlcommon SHARED mysql_common.cc mariadb_client.cc) +target_link_libraries(mysqlcommon maxscale-common) +set_target_properties(mysqlcommon PROPERTIES VERSION "2.0.0") +install_module(mysqlcommon core) add_subdirectory(MySQLBackend) add_subdirectory(MySQLClient) diff --git a/server/modules/protocol/MySQL/MySQLBackend/CMakeLists.txt b/server/modules/protocol/MySQL/MySQLBackend/CMakeLists.txt index 3dc29a6e7..1da92086b 100644 --- a/server/modules/protocol/MySQL/MySQLBackend/CMakeLists.txt +++ b/server/modules/protocol/MySQL/MySQLBackend/CMakeLists.txt @@ -1,7 +1,7 @@ -add_library(MySQLBackend SHARED mysql_backend.c) +add_library(mysqlbackend SHARED mysql_backend.c) # TODO: Refactor MySQLBackend so that COM_CHANGE_USER processing is # transparent to the protocol module. After this change, we don't need to # link against MySQLAuth. -target_link_libraries(MySQLBackend maxscale-common MySQLCommon MySQLAuth) -set_target_properties(MySQLBackend PROPERTIES VERSION "2.0.0") -install_module(MySQLBackend core) +target_link_libraries(mysqlbackend maxscale-common mysqlcommon mysqlauth) +set_target_properties(mysqlbackend PROPERTIES VERSION "2.0.0") +install_module(mysqlbackend core) diff --git a/server/modules/protocol/MySQL/MySQLClient/CMakeLists.txt b/server/modules/protocol/MySQL/MySQLClient/CMakeLists.txt index 00d2bbf06..5d2c56b7b 100644 --- a/server/modules/protocol/MySQL/MySQLClient/CMakeLists.txt +++ b/server/modules/protocol/MySQL/MySQLClient/CMakeLists.txt @@ -1,7 +1,7 @@ -add_library(MySQLClient SHARED mysql_client.cc) -target_link_libraries(MySQLClient maxscale-common MySQLCommon) -set_target_properties(MySQLClient PROPERTIES VERSION "1.0.0") -install_module(MySQLClient core) +add_library(mysqlclient SHARED mysql_client.cc) +target_link_libraries(mysqlclient maxscale-common mysqlcommon) +set_target_properties(mysqlclient PROPERTIES VERSION "1.0.0") +install_module(mysqlclient core) if(BUILD_TESTS) add_subdirectory(test) diff --git a/server/modules/protocol/MySQL/test/CMakeLists.txt b/server/modules/protocol/MySQL/test/CMakeLists.txt index 0723e3acc..a5f8e6c27 100644 --- a/server/modules/protocol/MySQL/test/CMakeLists.txt +++ b/server/modules/protocol/MySQL/test/CMakeLists.txt @@ -1,4 +1,4 @@ add_executable(test_parse_kill test_parse_kill.cc) -target_link_libraries(test_parse_kill maxscale-common MySQLCommon) +target_link_libraries(test_parse_kill maxscale-common mysqlcommon) add_test(test_parse_kill test_parse_kill) diff --git a/server/modules/routing/readwritesplit/CMakeLists.txt b/server/modules/routing/readwritesplit/CMakeLists.txt index 73ba0f832..dcea0c070 100644 --- a/server/modules/routing/readwritesplit/CMakeLists.txt +++ b/server/modules/routing/readwritesplit/CMakeLists.txt @@ -7,6 +7,6 @@ rwsplit_select_backends.cc rwsplit_session_cmd.cc rwsplit_tmp_table_multi.cc rwsplit_ps.cc) -target_link_libraries(readwritesplit maxscale-common MySQLCommon) +target_link_libraries(readwritesplit maxscale-common mysqlcommon) set_target_properties(readwritesplit PROPERTIES VERSION "1.0.2") install_module(readwritesplit core) diff --git a/server/modules/routing/schemarouter/CMakeLists.txt b/server/modules/routing/schemarouter/CMakeLists.txt index c2d3dd5d6..71ec116f1 100644 --- a/server/modules/routing/schemarouter/CMakeLists.txt +++ b/server/modules/routing/schemarouter/CMakeLists.txt @@ -1,5 +1,5 @@ add_library(schemarouter SHARED schemarouter.cc schemarouterinstance.cc schemaroutersession.cc shard_map.cc) -target_link_libraries(schemarouter maxscale-common MySQLCommon) +target_link_libraries(schemarouter maxscale-common mysqlcommon) add_dependencies(schemarouter pcre2) set_target_properties(schemarouter PROPERTIES VERSION "1.0.0") install_module(schemarouter core)