Add offsets for MySQL 5.6.32. Some whitespace cleanups.
parent
50b52078a4
commit
7c16d68069
|
@ -26,6 +26,7 @@
|
|||
#include "static_assert.h"
|
||||
|
||||
// utility macro to log also with a date as a prefix
|
||||
// FIXME: This is no longer used. Remove?
|
||||
#define log_with_date(f, ...) do {\
|
||||
struct tm tm_tmp;\
|
||||
time_t result = time(NULL);\
|
||||
|
@ -44,7 +45,7 @@
|
|||
// initialize static stuff
|
||||
ThdOffsets Audit_formatter::thd_offsets = { 0 };
|
||||
Audit_handler *Audit_handler::m_audit_handler_list[Audit_handler::MAX_AUDIT_HANDLERS_NUM];
|
||||
const char *Audit_json_formatter::DEF_MSG_DELIMITER = "\\n";
|
||||
const char *Audit_json_formatter::DEF_MSG_DELIMITER = "\\n"; // FIXME: This is used ...
|
||||
|
||||
#if MYSQL_VERSION_ID < 50709
|
||||
#define C_STRING_WITH_LEN(X) ((char *) (X)), ((size_t) (sizeof(X) - 1))
|
||||
|
@ -233,7 +234,7 @@ int Audit_file_handler::open(const char *io_dest, bool log_errors)
|
|||
if (res)
|
||||
{
|
||||
sql_print_error(
|
||||
"%s unable to set bufzie [%zd (%ld)] for file %s: %s.",
|
||||
"%s unable to set bufsize [%zd (%ld)] for file %s: %s.",
|
||||
AUDIT_LOG_PREFIX, bufsize, m_bufsize, m_io_dest, strerror(errno));
|
||||
}
|
||||
sql_print_information("%s bufsize for file [%s]: %zd. Value of json_file_bufsize: %ld.", AUDIT_LOG_PREFIX, m_io_dest,
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
const ThdOffsets thd_offsets_arr[] =
|
||||
{
|
||||
/* +++ MYSQL 64 OFFSETS GO HERE +++ */
|
||||
//offsets for: /mysqlrpm/5.6.32/usr/sbin/mysqld (5.6.32)
|
||||
{"5.6.32","e7fb65c8c8c817e58de0a1ce9dcad845", 6992, 7040, 4000, 4520, 72, 2704, 96, 0, 32, 104, 136, 7128},
|
||||
//offsets for: /mysqlrpm/5.5.50/usr/sbin/mysqld (5.5.50)
|
||||
{"5.5.50","c1b990f432d684f1d5abe3969146ee9d", 6144, 6192, 3816, 4312, 88, 2592, 96, 0, 32, 104, 120, 6264},
|
||||
//offsets for: /mysqlrpm/5.6.31/usr/sbin/mysqld (5.6.31)
|
||||
|
@ -437,6 +439,8 @@ const ThdOffsets thd_offsets_arr[] =
|
|||
const ThdOffsets thd_offsets_arr[] =
|
||||
{
|
||||
/* +++ MYSQL 32 OFFSETS GO HERE +++ */
|
||||
//offsets for: /mysqlrpm/5.6.32/usr/sbin/mysqld (5.6.32)
|
||||
{"5.6.32","f3b529d1a6c2d051f9ee0930004129ab", 4676, 4704, 2660, 3052, 36, 1748, 60, 0, 20, 64, 72, 4776},
|
||||
//offsets for: /mysqlrpm/5.5.50/usr/sbin/mysqld (5.5.50)
|
||||
{"5.5.50","2adacdba4c475e574dedbf97366159c7", 3872, 3900, 2368, 2748, 44, 1656, 60, 0, 20, 64, 60, 3956},
|
||||
//offsets for: /mysqlrpm/5.6.31/usr/sbin/mysqld (5.6.31)
|
||||
|
|
|
@ -778,7 +778,7 @@ static bool parse_thd_offsets_string (char *poffsets_string)
|
|||
|
||||
for (size_t j = 0; j < len; j++)
|
||||
{
|
||||
if (!((poffset_str[j] >= '0' && poffset_str[j] <= '9') || poffset_str[j] == ' ' || poffset_str[j] == ','))
|
||||
if (! (isdigit(poffset_str[j]) || poffset_str[j] == ' ' || poffset_str[j] == ','))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -1431,6 +1431,7 @@ static void json_socket_name_update(THD *thd, struct st_mysql_sys_var *var, void
|
|||
|
||||
const char *str = str_val;
|
||||
const size_t buff_len = array_elements(json_socket_name_buff) - 1;
|
||||
|
||||
// copy str to buffer only if str is not pointing to buff
|
||||
if (NULL == str)
|
||||
{
|
||||
|
@ -1440,9 +1441,10 @@ static void json_socket_name_update(THD *thd, struct st_mysql_sys_var *var, void
|
|||
{
|
||||
strncpy(json_socket_name_buff, str, buff_len);
|
||||
}
|
||||
|
||||
if (strlen(json_socket_name_buff) == 0 && (mysqld_port > 0 || mysqld_unix_port)) // set default
|
||||
{
|
||||
const char *name_prefix = "/tmp/mysql.audit_";
|
||||
const char *name_prefix = "/var/run/db-audit/mysql.audit_";
|
||||
|
||||
size_t indx = strlen(name_prefix); // count how much to move forward the buff
|
||||
strncpy(json_socket_name_buff, name_prefix, buff_len);
|
||||
|
@ -1830,7 +1832,7 @@ static MYSQL_SYSVAR_STR(json_log_file, json_file_handler.m_io_dest,
|
|||
NULL, NULL, "mysql-audit.json");
|
||||
static MYSQL_SYSVAR_LONG(json_file_bufsize, json_file_handler.m_bufsize,
|
||||
PLUGIN_VAR_RQCMDARG,
|
||||
"AUDIT plugin json log file buffer size. Buffer size in bytes (lager size may improve performance). 0 = use default size, 1 = no buffering. If changed during runtime need to perform a flush for the new value to take affect.",
|
||||
"AUDIT plugin json log file buffer size. Buffer size in bytes (larger size may improve performance). 0 = use default size, 1 = no buffering. If changed during runtime need to perform a flush for the new value to take affect.",
|
||||
NULL, NULL, 0, 1, 262144, 0);
|
||||
|
||||
static MYSQL_SYSVAR_UINT(json_file_sync, json_file_handler.m_sync_period,
|
||||
|
@ -1922,7 +1924,7 @@ static MYSQL_SYSVAR_STR(password_masking_cmds, password_masking_cmds_string,
|
|||
PLUGIN_VAR_RQCMDARG,
|
||||
"AUDIT plugin commands to apply password masking regex to, comma separated",
|
||||
NULL, password_masking_cmds_string_update,
|
||||
// set passowrd is recoreded as set_option
|
||||
// set password is recorded as set_option
|
||||
"CREATE_USER,GRANT,SET_OPTION,SLAVE_START,CREATE_SERVER,ALTER_SERVER,CHANGE_MASTER");
|
||||
static MYSQL_SYSVAR_STR(whitelist_users, whitelist_users_string,
|
||||
PLUGIN_VAR_RQCMDARG,
|
||||
|
|
Loading…
Reference in New Issue