You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
@@ -30,6 +30,6 @@ IF(UNIX)
|
||||
|
||||
# presumably this will be used for libmysql*.so symlinks
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${symlink_name} DESTINATION ${install_path}
|
||||
COMPONENT Development)
|
||||
COMPONENT SharedLibraries)
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
@@ -158,7 +158,6 @@ enum enum_server_command
|
||||
#define CLIENT_PS_MULTI_RESULTS (1UL << 18)
|
||||
#define CLIENT_PLUGIN_AUTH (1UL << 19)
|
||||
#define CLIENT_CONNECT_ATTRS (1UL << 20)
|
||||
#define CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA (1UL << 21)
|
||||
#define CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS (1UL << 22)
|
||||
#define CLIENT_SESSION_TRACKING (1UL << 23)
|
||||
#define CLIENT_PROGRESS (1UL << 29) /* client supports progress indicator */
|
||||
@@ -205,7 +204,6 @@ enum enum_server_command
|
||||
CLIENT_REMEMBER_OPTIONS |\
|
||||
CLIENT_PLUGIN_AUTH |\
|
||||
CLIENT_SESSION_TRACKING |\
|
||||
CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA |\
|
||||
CLIENT_CONNECT_ATTRS)
|
||||
|
||||
#define CLIENT_CAPABILITIES (CLIENT_MYSQL | \
|
||||
@@ -217,7 +215,6 @@ enum enum_server_command
|
||||
CLIENT_PROTOCOL_41 |\
|
||||
CLIENT_PLUGIN_AUTH |\
|
||||
CLIENT_SESSION_TRACKING |\
|
||||
CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA |\
|
||||
CLIENT_CONNECT_ATTRS)
|
||||
|
||||
#define CLIENT_DEFAULT_FLAGS ((CLIENT_SUPPORTED_FLAGS & ~CLIENT_COMPRESS)\
|
||||
|
@@ -12,7 +12,7 @@ static int dummy_fallback_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql __attr
|
||||
extern void read_user_name(char *name);
|
||||
extern char *ma_send_connect_attr(MYSQL *mysql, unsigned char *buffer);
|
||||
extern int ma_read_ok_packet(MYSQL *mysql, uchar *pos, ulong length);
|
||||
extern unsigned char *mysql_net_store_length(unsigned char *packet, size_t length);
|
||||
|
||||
typedef struct {
|
||||
int (*read_packet)(struct st_plugin_vio *vio, uchar **buf);
|
||||
int (*write_packet)(struct st_plugin_vio *vio, const uchar *pkt, size_t pkt_len);
|
||||
@@ -323,22 +323,10 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
|
||||
{
|
||||
if (mysql->server_capabilities & CLIENT_SECURE_CONNECTION)
|
||||
{
|
||||
/* CONC-493: Support for passwords > 255 characters */
|
||||
if (mysql->server_capabilities & CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA)
|
||||
{
|
||||
unsigned char *to= mysql_net_store_length((uchar *)end, data_len);
|
||||
if (data_len)
|
||||
memcpy(to, data, data_len);
|
||||
end= (char *)to + data_len;
|
||||
printf("length encoded\n");
|
||||
} else {
|
||||
if (data_len > 255)
|
||||
goto error;
|
||||
*end++= data_len;
|
||||
memcpy(end, data, data_len);
|
||||
end+= data_len;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DBUG_ASSERT(data_len == SCRAMBLE_LENGTH_323 + 1); /* incl. \0 at the end */
|
||||
|
@@ -1783,37 +1783,7 @@ static int test_default_auth(MYSQL *my __attribute__((unused)))
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_conc493(MYSQL *mysql)
|
||||
{
|
||||
MYSQL *my;
|
||||
char long_password[300];
|
||||
char query[512];
|
||||
int rc;
|
||||
|
||||
SKIP_SKYSQL;
|
||||
|
||||
memset(&long_password, 'A', 299);
|
||||
long_password[299]= 0;
|
||||
|
||||
sprintf(query, "GRANT ALL PRIVILEGES ON *.* TO 'foo1'@'%%' IDENTIFIED BY '%s' WITH GRANT OPTION", long_password);
|
||||
rc= mysql_query(mysql, query);
|
||||
check_mysql_rc(rc, mysql);
|
||||
|
||||
my= mysql_init(NULL);
|
||||
if (!my_test_connect(my, hostname, "foo1", long_password, schema, port, socketname, CLIENT_REMEMBER_OPTIONS))
|
||||
{
|
||||
diag("Connection failed. Error: %s", mysql_error(my));
|
||||
mysql_close(my);
|
||||
exit(1);
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
mysql_close(my);
|
||||
return OK;
|
||||
}
|
||||
|
||||
struct my_tests_st my_tests[] = {
|
||||
{"test_conc493", test_conc493, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
||||
{"test_default_auth", test_default_auth, TEST_CONNECTION_NONE, 0, NULL, NULL},
|
||||
{"test_conc443", test_conc443, TEST_CONNECTION_NONE, 0, NULL, NULL},
|
||||
{"test_conc366", test_conc366, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
||||
|
Reference in New Issue
Block a user