MXS-1026: Prevent crash with NullAuth
The authenticator module will not crash but backend authentication will always fail.
This commit is contained in:
parent
6f7b572822
commit
1d9d325a01
@ -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})
|
||||
|
||||
|
@ -31,6 +31,9 @@
|
||||
#include <dcb.h>
|
||||
#include <buffer.h>
|
||||
|
||||
/** MXS-1026: Without MySQL protocol data structures, the NullAuth authenticator will crash. */
|
||||
#include <mysql_client_server_protocol.h>
|
||||
|
||||
/* @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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user