mirror of
https://github.com/MariaDB/server.git
synced 2026-04-21 15:55:53 +02:00
Merge 10.0.14 into 10.1
This commit is contained in:
commit
f62c12b405
2115 changed files with 88123 additions and 80328 deletions
|
|
@ -22,21 +22,47 @@ int main() {
|
|||
getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, 0);
|
||||
}" HAVE_PEERCRED)
|
||||
|
||||
IF (NOT HAVE_PEERCRED)
|
||||
# Hi, OpenBSD!
|
||||
CHECK_CXX_SOURCE_COMPILES(
|
||||
"#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
int main() {
|
||||
struct sockpeercred cred;
|
||||
getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, 0);
|
||||
}" HAVE_SOCKPEERCRED)
|
||||
ADD_DEFINITIONS(-Ducred=sockpeercred)
|
||||
IF (HAVE_PEERCRED)
|
||||
ADD_DEFINITIONS(-DHAVE_PEERCRED)
|
||||
SET(ok 1)
|
||||
ELSE()
|
||||
|
||||
# Hi, OpenBSD!
|
||||
CHECK_CXX_SOURCE_COMPILES(
|
||||
"#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
int main() {
|
||||
struct sockpeercred cred;
|
||||
getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, 0);
|
||||
}" HAVE_SOCKPEERCRED)
|
||||
|
||||
IF (HAVE_SOCKPEERCRED)
|
||||
ADD_DEFINITIONS(-DHAVE_SOCKPEERCRED)
|
||||
SET(ok 1)
|
||||
ELSE()
|
||||
|
||||
# FreeBSD, is that you?
|
||||
CHECK_CXX_SOURCE_COMPILES(
|
||||
"#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/ucred.h>
|
||||
int main() {
|
||||
struct xucred cred;
|
||||
getsockopt(0, 0, LOCAL_PEERCRED, &cred, 0);
|
||||
}" HAVE_XUCRED)
|
||||
|
||||
IF (HAVE_XUCRED)
|
||||
ADD_DEFINITIONS(-DHAVE_XUCRED)
|
||||
SET(ok 1)
|
||||
ELSE()
|
||||
|
||||
# Who else? Anyone?
|
||||
# C'mon, show your creativity, be different! ifdef's are fun, aren't they?
|
||||
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(HAVE_PEERCRED OR HAVE_SOCKPEERCRED)
|
||||
SET(AUTH_SOCKET_OK 1)
|
||||
ENDIF()
|
||||
|
||||
MYSQL_ADD_PLUGIN(auth_socket auth_socket.c ONLY_IF AUTH_SOCKET_OK MODULE_ONLY)
|
||||
MYSQL_ADD_PLUGIN(auth_socket auth_socket.c ONLY_IF ok MODULE_ONLY)
|
||||
|
||||
|
|
|
|||
|
|
@ -27,9 +27,29 @@
|
|||
#define _GNU_SOURCE 1 /* for struct ucred */
|
||||
|
||||
#include <mysql/plugin_auth.h>
|
||||
#include <sys/socket.h>
|
||||
#include <pwd.h>
|
||||
#include <string.h>
|
||||
#include <pwd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_PEERCRED
|
||||
#define level SOL_SOCKET
|
||||
|
||||
#elif defined HAVE_SOCKPEERCRED
|
||||
#define level SOL_SOCKET
|
||||
#define ucred sockpeercred
|
||||
|
||||
#elif defined HAVE_XUCRED
|
||||
#include <sys/un.h>
|
||||
#include <sys/ucred.h>
|
||||
#define level 0
|
||||
#define SO_PEERCRED LOCAL_PEERCRED
|
||||
#define uid cr_uid
|
||||
#define ucred xucred
|
||||
|
||||
#else
|
||||
#error impossible
|
||||
#endif
|
||||
|
||||
/**
|
||||
perform the unix socket based authentication
|
||||
|
|
@ -63,7 +83,7 @@ static int socket_auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
|
|||
return CR_ERROR;
|
||||
|
||||
/* get the UID of the client process */
|
||||
if (getsockopt(vio_info.socket, SOL_SOCKET, SO_PEERCRED, &cred, &cred_len))
|
||||
if (getsockopt(vio_info.socket, level, SO_PEERCRED, &cred, &cred_len))
|
||||
return CR_ERROR;
|
||||
|
||||
if (cred_len != sizeof(cred))
|
||||
|
|
|
|||
|
|
@ -217,7 +217,8 @@ int fill_feedback(THD *thd, TABLE_LIST *tables, COND *unused)
|
|||
tables->schema_table= i_s_feedback;
|
||||
res= res || fill_plugin_version(thd, tables)
|
||||
|| fill_misc_data(thd, tables)
|
||||
|| fill_linux_info(thd, tables);
|
||||
|| fill_linux_info(thd, tables)
|
||||
|| fill_collation_statistics(thd, tables);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ int fill_feedback(THD *thd, TABLE_LIST *tables, COND *cond);
|
|||
int fill_plugin_version(THD *thd, TABLE_LIST *tables);
|
||||
int fill_misc_data(THD *thd, TABLE_LIST *tables);
|
||||
int fill_linux_info(THD *thd, TABLE_LIST *tables);
|
||||
int fill_collation_statistics(THD *thd, TABLE_LIST *tables);
|
||||
|
||||
static const int SERVER_UID_SIZE= 29;
|
||||
extern char server_uid_buf[SERVER_UID_SIZE+1], *user_info;
|
||||
|
|
|
|||
|
|
@ -383,6 +383,25 @@ int fill_misc_data(THD *thd, TABLE_LIST *tables)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int fill_collation_statistics(THD *thd, TABLE_LIST *tables)
|
||||
{
|
||||
TABLE *table= tables->table;
|
||||
for (uint id= 1; id < MY_ALL_CHARSETS_SIZE; id++)
|
||||
{
|
||||
ulonglong count;
|
||||
if (my_collation_is_known_id(id) &&
|
||||
(count= my_collation_statistics_get_use_count(id)))
|
||||
{
|
||||
char name[MY_CS_NAME_SIZE + 32];
|
||||
size_t namelen= my_snprintf(name, sizeof(name),
|
||||
"Collation used %s",
|
||||
get_charset_name(id));
|
||||
INSERT2(name, namelen, (count, UNSIGNED));
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
||||
/**
|
||||
calculates the server unique identifier
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ maria_declare_plugin(metadata_lock_info)
|
|||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
MariaDB_PLUGIN_MATURITY_BETA,
|
||||
MariaDB_PLUGIN_MATURITY_GAMMA,
|
||||
}
|
||||
maria_declare_plugin_end;
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ public:
|
|||
char time[TIME_STRING_BUFFER_LENGTH];
|
||||
char total[TOTAL_STRING_BUFFER_LENGTH];
|
||||
if(i == bound_count())
|
||||
{
|
||||
{
|
||||
assert(sizeof(TIME_OVERFLOW) <= TIME_STRING_BUFFER_LENGTH);
|
||||
assert(sizeof(TIME_OVERFLOW) <= TOTAL_STRING_BUFFER_LENGTH);
|
||||
memcpy(time,TIME_OVERFLOW,sizeof(TIME_OVERFLOW));
|
||||
|
|
|
|||
|
|
@ -441,7 +441,7 @@ maria_declare_plugin(semisync_master)
|
|||
semi_sync_master_status_vars, /* status variables */
|
||||
semi_sync_master_system_vars, /* system variables */
|
||||
"1.0",
|
||||
MariaDB_PLUGIN_MATURITY_UNKNOWN
|
||||
MariaDB_PLUGIN_MATURITY_GAMMA
|
||||
}
|
||||
maria_declare_plugin_end;
|
||||
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ maria_declare_plugin(semisync_slave)
|
|||
semi_sync_slave_status_vars, /* status variables */
|
||||
semi_sync_slave_system_vars, /* system variables */
|
||||
"1.0",
|
||||
MariaDB_PLUGIN_MATURITY_UNKNOWN
|
||||
MariaDB_PLUGIN_MATURITY_GAMMA
|
||||
}
|
||||
maria_declare_plugin_end;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ IF(WIN32)
|
|||
LINK_LIBRARIES Secur32
|
||||
MODULE_ONLY COMPONENT SharedLibraries)
|
||||
|
||||
#INSTALL_DEBUG_SYMBOLS(auth_win_client)
|
||||
#IF(MSVC)
|
||||
# INSTALL_DEBUG_TARGET(auth_win_client DESTINATION ${INSTALL_LIBDIR}/debug)
|
||||
#ENDIF()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue