From 0d764841f20fd520dbef74782e950e673711f8db Mon Sep 17 00:00:00 2001 From: Tohru Hamaguchi Date: Fri, 30 Jan 2015 18:42:57 +0900 Subject: [PATCH] I need "MYSQL_SECURE_AUTH" parameter... --- _mysql.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/_mysql.c b/_mysql.c index 5b81c79d..3cc1e1ce 100644 --- a/_mysql.c +++ b/_mysql.c @@ -559,13 +559,14 @@ _mysql_ConnectionObject_Initialize( *db = NULL, *unix_socket = NULL; unsigned int port = 0; unsigned int client_flag = 0; + unsigned int secure_auth = -1; static char *kwlist[] = { "host", "user", "passwd", "db", "port", "unix_socket", "conv", "connect_timeout", "compress", "named_pipe", "init_command", "read_default_file", "read_default_group", "client_flag", "ssl", - "local_infile", + "local_infile", "secure_auth", #ifdef HAVE_MYSQL_OPT_TIMEOUTS "read_timeout", "write_timeout", @@ -587,9 +588,9 @@ _mysql_ConnectionObject_Initialize( if (!PyArg_ParseTupleAndKeywords(args, kwargs, #ifdef HAVE_MYSQL_OPT_TIMEOUTS - "|ssssisOiiisssiOiii:connect", + "|ssssisOiiisssiOiiii:connect", #else - "|ssssisOiiisssiOi:connect", + "|ssssisOiiisssiOii:connect", #endif kwlist, &host, &user, &passwd, &db, @@ -599,7 +600,7 @@ _mysql_ConnectionObject_Initialize( &init_command, &read_default_file, &read_default_group, &client_flag, &ssl, - &local_infile + &local_infile, &secure_auth #ifdef HAVE_MYSQL_OPT_TIMEOUTS , &read_timeout , &write_timeout @@ -667,6 +668,9 @@ _mysql_ConnectionObject_Initialize( if (local_infile != -1) mysql_options(&(self->connection), MYSQL_OPT_LOCAL_INFILE, (char *) &local_infile); + if (secure_auth != -1) + mysql_options(&(self->connection), MYSQL_SECURE_AUTH, &secure_auth); + #if HAVE_OPENSSL if (ssl) mysql_ssl_set(&(self->connection),