diff --git a/server/modules/authenticator/CMakeLists.txt b/server/modules/authenticator/CMakeLists.txt index bb8fa05d7..9adaf5e52 100644 --- a/server/modules/authenticator/CMakeLists.txt +++ b/server/modules/authenticator/CMakeLists.txt @@ -4,7 +4,7 @@ set_target_properties(MySQLAuth PROPERTIES VERSION "1.0.0") install(TARGETS MySQLAuth DESTINATION ${MAXSCALE_LIBDIR}) add_library(NullAuth SHARED null_auth.c) -target_link_libraries(NullAuth maxscale-common) +target_link_libraries(NullAuth maxscale-common MySQLClient) set_target_properties(NullAuth PROPERTIES VERSION "1.0.0") install(TARGETS NullAuth DESTINATION ${MAXSCALE_LIBDIR}) diff --git a/server/modules/authenticator/null_auth.c b/server/modules/authenticator/null_auth.c index c4ca31f08..0ca01de23 100644 --- a/server/modules/authenticator/null_auth.c +++ b/server/modules/authenticator/null_auth.c @@ -31,6 +31,9 @@ #include #include +/** MXS-1026: Without MySQL protocol data structures, the NullAuth authenticator will crash. */ +#include + /* @see function load_module in load_utils.c for explanation of the following * lint directives. */ @@ -124,6 +127,11 @@ null_auth_authenticate(DCB *dcb) static int null_auth_set_protocol_data(DCB *dcb, GWBUF *buf) { + /** MXS-1026: This will just prevent a crash when the NullAuth authenticator + * is used. This does not provide a way to use MaxScale with no authentication. */ + dcb->data = calloc(1, sizeof(MYSQL_session)); + dcb->protocol = mysql_protocol_init(dcb, dcb->fd); + return 0; }