You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-08 14:02:17 +03:00
Fix misc.warnings.
SSL_LIBRARIES should be set to secur32 with SCHANNEL. malloc/free declarations were not found in sspi_client, so compiler assumed malloc() returns an int.
This commit is contained in:
@@ -264,6 +264,7 @@ IF(NOT WITH_SSL STREQUAL "OFF")
|
|||||||
ADD_DEFINITIONS(-DHAVE_SCHANNEL -DHAVE_TLS)
|
ADD_DEFINITIONS(-DHAVE_SCHANNEL -DHAVE_TLS)
|
||||||
SET(SSL_SOURCES "${CC_SOURCE_DIR}/libmariadb/secure/schannel.c" "${CC_SOURCE_DIR}/libmariadb/secure/ma_schannel.c")
|
SET(SSL_SOURCES "${CC_SOURCE_DIR}/libmariadb/secure/schannel.c" "${CC_SOURCE_DIR}/libmariadb/secure/ma_schannel.c")
|
||||||
INCLUDE_DIRECTORIES("${CC_SOURCE_DIR}/plugins/pvio/")
|
INCLUDE_DIRECTORIES("${CC_SOURCE_DIR}/plugins/pvio/")
|
||||||
|
SET(SSL_LIBRARIES secur32)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
@@ -32,6 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <SecExt.h>
|
#include <SecExt.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <mysql/plugin_auth.h>
|
#include <mysql/plugin_auth.h>
|
||||||
#include <mysql.h>
|
#include <mysql.h>
|
||||||
|
@@ -22,10 +22,6 @@
|
|||||||
|
|
||||||
static int skip_ssl= 1;
|
static int skip_ssl= 1;
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#define pthread_exit(A) _endthreadex(0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const char *ssluser= "ssluser";
|
const char *ssluser= "ssluser";
|
||||||
const char *sslpw= "sslpw";
|
const char *sslpw= "sslpw";
|
||||||
char sslhost[128];
|
char sslhost[128];
|
||||||
@@ -266,8 +262,7 @@ DWORD WINAPI ssl_thread(void *dummy)
|
|||||||
|
|
||||||
if (!(mysql= mysql_init(NULL)))
|
if (!(mysql= mysql_init(NULL)))
|
||||||
{
|
{
|
||||||
mysql_thread_end();
|
goto end;
|
||||||
pthread_exit(NULL);
|
|
||||||
}
|
}
|
||||||
mysql_ssl_set(mysql, 0, 0, "@CMAKE_SOURCE_DIR@/unittest/libmariadb/certs/ca-cert.pem", 0, 0);
|
mysql_ssl_set(mysql, 0, 0, "@CMAKE_SOURCE_DIR@/unittest/libmariadb/certs/ca-cert.pem", 0, 0);
|
||||||
|
|
||||||
@@ -275,18 +270,20 @@ DWORD WINAPI ssl_thread(void *dummy)
|
|||||||
port, socketname, 0))
|
port, socketname, 0))
|
||||||
{
|
{
|
||||||
diag(">Error: %s", mysql_error(mysql));
|
diag(">Error: %s", mysql_error(mysql));
|
||||||
mysql_close(mysql);
|
goto end;
|
||||||
mysql_thread_end();
|
|
||||||
pthread_exit(NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pthread_mutex_lock(&LOCK_test);
|
pthread_mutex_lock(&LOCK_test);
|
||||||
mysql_query(mysql, "UPDATE ssltest SET a=a+1");
|
mysql_query(mysql, "UPDATE ssltest SET a=a+1");
|
||||||
pthread_mutex_unlock(&LOCK_test);
|
pthread_mutex_unlock(&LOCK_test);
|
||||||
mysql_close(mysql);
|
|
||||||
|
end:
|
||||||
|
if(mysql)
|
||||||
|
mysql_close(mysql);
|
||||||
mysql_thread_end();
|
mysql_thread_end();
|
||||||
pthread_exit(0);
|
#ifdef _WIN32
|
||||||
return;
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int test_ssl_threads(MYSQL *mysql)
|
static int test_ssl_threads(MYSQL *mysql)
|
||||||
@@ -775,7 +772,7 @@ static int test_ssl_fp_list(MYSQL *unused __attribute__((unused)))
|
|||||||
static int test_ssl_version(MYSQL *unused __attribute__((unused)))
|
static int test_ssl_version(MYSQL *unused __attribute__((unused)))
|
||||||
{
|
{
|
||||||
unsigned int iversion;
|
unsigned int iversion;
|
||||||
const char *version, *library;
|
char *version, *library;
|
||||||
MYSQL *my;
|
MYSQL *my;
|
||||||
|
|
||||||
if (check_skip_ssl())
|
if (check_skip_ssl())
|
||||||
|
Reference in New Issue
Block a user