From dac2dfc2a306f618b3beea0844b3f04e87338a99 Mon Sep 17 00:00:00 2001 From: Guy Lichtman Date: Thu, 4 Oct 2012 10:18:18 +0200 Subject: [PATCH] Fix for bug found with vio. Where mysql 5.1 ndb cluster uses a different struct from mysql 5.1. --- compiling.txt | 0 include/audit_handler.h | 7 +- include/mysql_inc.h | 4 + src/audit_handler.cc | 1002 +++++++++++++++++++-------------------- src/audit_plugin.cc | 922 +++++++++++++++++------------------ src/hot_patch.cc | 392 +++++++-------- 6 files changed, 1167 insertions(+), 1160 deletions(-) mode change 100755 => 100644 compiling.txt mode change 100755 => 100644 include/audit_handler.h mode change 100755 => 100644 src/audit_handler.cc mode change 100755 => 100644 src/audit_plugin.cc diff --git a/compiling.txt b/compiling.txt old mode 100755 new mode 100644 diff --git a/include/audit_handler.h b/include/audit_handler.h old mode 100755 new mode 100644 index db99783..21e4649 --- a/include/audit_handler.h +++ b/include/audit_handler.h @@ -432,13 +432,14 @@ protected: */ virtual void handler_log_audit(ThdSesData *pThdData); //Vio we write to - Vio * m_vio; + //define as void* so we don't access members directly + void * m_vio; void close_vio() { if (m_vio) { - vio_close(m_vio); - vio_delete(m_vio); + vio_close((Vio*)m_vio); + vio_delete((Vio*)m_vio); } m_vio = NULL; } diff --git a/include/mysql_inc.h b/include/mysql_inc.h index dfe8cb4..17cba71 100644 --- a/include/mysql_inc.h +++ b/include/mysql_inc.h @@ -8,6 +8,10 @@ #define MYSQL_DYNAMIC_PLUGIN #define MYSQL_SERVER 1 +//Fix for VIO. We don't want to using method mapping as then a change in the struct will cause the offsets compiled with to +//be wrong. As is the case with ndb which uses a version of Vio with support for ipv6 similar to 5.5 but different from 5.1 +#define DONT_MAP_VIO + #include #include //version 5.5.x doesn't contain mysql_priv.h . We need to add the includes provided by it. diff --git a/src/audit_handler.cc b/src/audit_handler.cc old mode 100755 new mode 100644 index a8e67c8..20051d7 --- a/src/audit_handler.cc +++ b/src/audit_handler.cc @@ -1,507 +1,507 @@ -/* - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - -/* - * audit_handler.cc - * - * Created on: Feb 6, 2011 - * Author: guyl - */ -#include "audit_handler.h" -//for definition of sockaddr_un -#include -#include "static_assert.h" - - - -/** - * Will write into buff the date prefix for txt formatter. Return the number of bytes written - * (not including null terminate). - */ -static int log_date_prefix(char * buff, size_t buff_size) -{ - struct tm tm_tmp; - time_t result= time(NULL); - localtime_r(&result, &tm_tmp); - //my_snprintf is limited regarding formatting but sufficient for this - return my_snprintf(buff, buff_size, "%02d%02d%02d %2d:%02d:%02d: ", - tm_tmp.tm_year % 100, - tm_tmp.tm_mon+1, - tm_tmp.tm_mday, - tm_tmp.tm_hour, - tm_tmp.tm_min, - tm_tmp.tm_sec); -} - - -//utility macro to log also with a date as a prefix -#define log_with_date(f, ...) do{\ - struct tm tm_tmp;\ - time_t result= time(NULL);\ - localtime_r(&result, &tm_tmp);\ - fprintf(f, "%02d%02d%02d %2d:%02d:%02d: ",\ - tm_tmp.tm_year % 100,\ - tm_tmp.tm_mon+1,\ - tm_tmp.tm_mday,\ - tm_tmp.tm_hour,\ - tm_tmp.tm_min,\ - tm_tmp.tm_sec);\ - fprintf(f, __VA_ARGS__);\ -}while(0) - - -//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"; - -#define C_STRING_WITH_LEN(X) ((char *) (X)), ((size_t) (sizeof(X) - 1)) - - -const char * Audit_formatter::retrive_object_type (TABLE_LIST *pObj) -{ - if (pObj->view) - { - return "VIEW"; - } - return "TABLE"; -} - - -void Audit_handler::stop_all() -{ - for (int i = 0; i < MAX_AUDIT_HANDLERS_NUM; ++i) - { - if (m_audit_handler_list[i] != NULL) - { - m_audit_handler_list[i]->set_enable(false); - } - } -} - -void Audit_handler::log_audit_all(ThdSesData *pThdData) -{ - for (int i = 0; i < MAX_AUDIT_HANDLERS_NUM; ++i) - { - if (m_audit_handler_list[i] != NULL) - { - m_audit_handler_list[i]->log_audit(pThdData); - } - } -} - -void Audit_handler::set_enable(bool val) -{ - lock_exclusive(); - if (m_enabled == val) //we are already enabled simply return - { - unlock(); - return; - } - m_enabled = val; - if (m_enabled) - { - //call the startup of the handler - handler_start(); - } - else - { - //call the cleanup of the handler - handler_stop(); - } - unlock(); -} - -void Audit_handler::flush() -{ - lock_exclusive(); - if (!m_enabled) //if not running we don't flush - { - unlock(); - return; - } - //call the cleanup of the handler - handler_stop(); - //call the startup of the handler - handler_start(); - sql_print_information("%s Log flush complete.", AUDIT_LOG_PREFIX); - unlock(); -} - -void Audit_handler::log_audit(ThdSesData *pThdData) -{ - lock_shared(); - if (!m_enabled) - { - unlock(); - return; - } - //sanity check that offsets match - //we can also consider using secutiry context function to do some sanity checks - // char buffer[2048]; - // thd_security_context(thd, buffer, 2048, 2000); - // fprintf(log_file, "info from security context: %s\n", buffer); - unsigned long inst_thread_id = Audit_formatter::thd_inst_thread_id(pThdData->getTHD()); - unsigned long plug_thread_id = thd_get_thread_id(pThdData->getTHD()); - if (inst_thread_id != plug_thread_id) - { - if (m_print_offset_err) - { - m_print_offset_err = false; - sql_print_error( - "%s Thread id from thd_get_thread_id doesn't match calculated value from offset %lu <> %lu. Aborting!", - AUDIT_LOG_PREFIX, inst_thread_id, plug_thread_id); - } - } - else - {//offsets are good - m_print_offset_err = true; //mark to print offset err to log incase we encounter in the future - handler_log_audit(pThdData); - } - unlock(); -} - -ssize_t Audit_file_handler::write(const char * data, size_t size) -{ - return my_fwrite(m_log_file, (uchar *) data, size, MYF(0)); -} - -void Audit_file_handler::handler_start() -{ - pthread_mutex_lock(&LOCK_io); - char format_name[FN_REFLEN]; - fn_format(format_name, m_filename, "", "", MY_UNPACK_FILENAME); - m_log_file = my_fopen(format_name, O_RDWR | O_APPEND, MYF(0)); - if (!m_log_file) - { - sql_print_error( - "%s unable to create %s: %s. audit file handler disabled!!", - AUDIT_LOG_PREFIX, m_filename, strerror(errno)); - m_enabled = false; - } - else - { - ssize_t res = m_formatter->start_msg_format(this); - /* - sanity check of writing to the log. If we fail. We will print an erorr and disable this handler. - */ - if (res < 0 || fflush(m_log_file) != 0) - { - sql_print_error( - "%s unable to write to %s: %s. Disabling audit handler.", - AUDIT_LOG_PREFIX, m_log_file, strerror(errno)); - close_file(); - m_enabled = false; - } - } - pthread_mutex_unlock(&LOCK_io); -} -void Audit_file_handler::handler_stop() -{ - pthread_mutex_lock(&LOCK_io); - m_formatter->stop_msg_format(this); - close_file(); - pthread_mutex_unlock(&LOCK_io); -} - -void Audit_file_handler::handler_log_audit(ThdSesData *pThdData) -{ - pthread_mutex_lock(&LOCK_io); - m_formatter->event_format(pThdData, this); - if (++m_sync_counter >= m_sync_period && m_sync_period) - { - m_sync_counter = 0; - //Note fflush() only flushes the user space buffers provided by the C library. - //To ensure that the data is physically stored on disk the kernel buffers must be flushed too, - //e.g. with sync(2) or fsync(2). - fflush(m_log_file); - int fd = fileno(m_log_file); - my_sync(fd, MYF(MY_WME)); - } - pthread_mutex_unlock(&LOCK_io); -} - -/////////////////// Audit_socket_handler ////////////////////////////////// - -ssize_t Audit_socket_handler::write(const char * data, size_t size) -{ - return vio_write(m_vio, (const uchar *) data, size); -} - -void Audit_socket_handler::handler_start() -{ - pthread_mutex_lock(&LOCK_io); - //open the socket - int sock = socket(AF_UNIX,SOCK_STREAM,0); - if (sock < 0) - { - sql_print_error( - "%s unable to create socket: %s. audit socket handler disabled!!", - AUDIT_LOG_PREFIX, strerror(errno)); - m_enabled = false; - pthread_mutex_unlock(&LOCK_io); - return; - } - - //connect the socket - m_vio= vio_new(sock, VIO_TYPE_SOCKET, VIO_LOCALHOST); - struct sockaddr_un UNIXaddr; - UNIXaddr.sun_family = AF_UNIX; - strmake(UNIXaddr.sun_path, m_sockname, sizeof(UNIXaddr.sun_path)-1); - if (my_connect(sock,(struct sockaddr *) &UNIXaddr, sizeof(UNIXaddr), - m_connect_timeout)) - { - sql_print_error( - "%s unable to connect to socket: %s. err: %s. audit socket handler disabled!!", - AUDIT_LOG_PREFIX, m_sockname, strerror(errno)); - close_vio(); - m_enabled = false; - pthread_mutex_unlock(&LOCK_io); - return; - - } - ssize_t res = m_formatter->start_msg_format(this); - /* - sanity check of writing to the log. If we fail. We will print an erorr and disable this handler. - */ - if (res < 0) - { - sql_print_error( - "%s unable to write to %s: %s. Disabling audit handler.", - AUDIT_LOG_PREFIX, m_sockname, strerror(errno)); - close_vio(); - m_enabled = false; - } - pthread_mutex_unlock(&LOCK_io); -} -void Audit_socket_handler::handler_stop() -{ - pthread_mutex_lock(&LOCK_io); - m_formatter->stop_msg_format(this); - close_vio(); - pthread_mutex_unlock(&LOCK_io); -} - -void Audit_socket_handler::handler_log_audit(ThdSesData *pThdData) -{ - pthread_mutex_lock(&LOCK_io); - m_formatter->event_format(pThdData, this); - pthread_mutex_unlock(&LOCK_io); -} - -//////////////////////// Audit Socket handler end /////////////////////////////////////////// - - - - -static inline yajl_gen_status yajl_add_string(yajl_gen hand, const char * str) -{ - return yajl_gen_string(hand, (const unsigned char*)str, strlen(str)); -} - -static inline void yajl_add_string_val(yajl_gen hand, const char * name, const char* val) -{ - if(0 == val) - { - return; //we don't add NULL values to json - } - yajl_add_string(hand, name); - yajl_add_string(hand, val); -} - -static inline void yajl_add_string_val(yajl_gen hand, const char * name, const char* val, size_t val_len) -{ - yajl_add_string(hand, name); - yajl_gen_string(hand, (const unsigned char*)val, val_len); -} - -static inline void yajl_add_uint64(yajl_gen gen, const char * name, uint64 num) -{ - const size_t max_int64_str_len = 21; - char buf[max_int64_str_len]; - snprintf(buf, max_int64_str_len, "%llu", num); - yajl_add_string_val(gen, name, buf); -} -static inline void yajl_add_obj( yajl_gen gen, const char *db,const char* ptype,const char * name =NULL) -{ - yajl_add_string_val(gen, "db", db); - if (name) - { - yajl_add_string_val(gen, "name", name); - } - yajl_add_string_val(gen, "obj_type",ptype); -} - -//void Audit_file_handler::print_sleep (THD *thd, int delay_ms) -//{ -// -// unsigned long thdid = thd_get_thread_id(thd); -// yajl_gen gen = yajl_gen_alloc(&config, NULL); -// yajl_gen_array_open(gen); -// yajl_gen_map_open(gen); +/* + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +/* + * audit_handler.cc + * + * Created on: Feb 6, 2011 + * Author: guyl + */ +#include "audit_handler.h" +//for definition of sockaddr_un +#include +#include "static_assert.h" + + + +/** + * Will write into buff the date prefix for txt formatter. Return the number of bytes written + * (not including null terminate). + */ +static int log_date_prefix(char * buff, size_t buff_size) +{ + struct tm tm_tmp; + time_t result= time(NULL); + localtime_r(&result, &tm_tmp); + //my_snprintf is limited regarding formatting but sufficient for this + return my_snprintf(buff, buff_size, "%02d%02d%02d %2d:%02d:%02d: ", + tm_tmp.tm_year % 100, + tm_tmp.tm_mon+1, + tm_tmp.tm_mday, + tm_tmp.tm_hour, + tm_tmp.tm_min, + tm_tmp.tm_sec); +} + + +//utility macro to log also with a date as a prefix +#define log_with_date(f, ...) do{\ + struct tm tm_tmp;\ + time_t result= time(NULL);\ + localtime_r(&result, &tm_tmp);\ + fprintf(f, "%02d%02d%02d %2d:%02d:%02d: ",\ + tm_tmp.tm_year % 100,\ + tm_tmp.tm_mon+1,\ + tm_tmp.tm_mday,\ + tm_tmp.tm_hour,\ + tm_tmp.tm_min,\ + tm_tmp.tm_sec);\ + fprintf(f, __VA_ARGS__);\ +}while(0) + + +//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"; + +#define C_STRING_WITH_LEN(X) ((char *) (X)), ((size_t) (sizeof(X) - 1)) + + +const char * Audit_formatter::retrive_object_type (TABLE_LIST *pObj) +{ + if (pObj->view) + { + return "VIEW"; + } + return "TABLE"; +} + + +void Audit_handler::stop_all() +{ + for (int i = 0; i < MAX_AUDIT_HANDLERS_NUM; ++i) + { + if (m_audit_handler_list[i] != NULL) + { + m_audit_handler_list[i]->set_enable(false); + } + } +} + +void Audit_handler::log_audit_all(ThdSesData *pThdData) +{ + for (int i = 0; i < MAX_AUDIT_HANDLERS_NUM; ++i) + { + if (m_audit_handler_list[i] != NULL) + { + m_audit_handler_list[i]->log_audit(pThdData); + } + } +} + +void Audit_handler::set_enable(bool val) +{ + lock_exclusive(); + if (m_enabled == val) //we are already enabled simply return + { + unlock(); + return; + } + m_enabled = val; + if (m_enabled) + { + //call the startup of the handler + handler_start(); + } + else + { + //call the cleanup of the handler + handler_stop(); + } + unlock(); +} + +void Audit_handler::flush() +{ + lock_exclusive(); + if (!m_enabled) //if not running we don't flush + { + unlock(); + return; + } + //call the cleanup of the handler + handler_stop(); + //call the startup of the handler + handler_start(); + sql_print_information("%s Log flush complete.", AUDIT_LOG_PREFIX); + unlock(); +} + +void Audit_handler::log_audit(ThdSesData *pThdData) +{ + lock_shared(); + if (!m_enabled) + { + unlock(); + return; + } + //sanity check that offsets match + //we can also consider using secutiry context function to do some sanity checks + // char buffer[2048]; + // thd_security_context(thd, buffer, 2048, 2000); + // fprintf(log_file, "info from security context: %s\n", buffer); + unsigned long inst_thread_id = Audit_formatter::thd_inst_thread_id(pThdData->getTHD()); + unsigned long plug_thread_id = thd_get_thread_id(pThdData->getTHD()); + if (inst_thread_id != plug_thread_id) + { + if (m_print_offset_err) + { + m_print_offset_err = false; + sql_print_error( + "%s Thread id from thd_get_thread_id doesn't match calculated value from offset %lu <> %lu. Aborting!", + AUDIT_LOG_PREFIX, inst_thread_id, plug_thread_id); + } + } + else + {//offsets are good + m_print_offset_err = true; //mark to print offset err to log incase we encounter in the future + handler_log_audit(pThdData); + } + unlock(); +} + +ssize_t Audit_file_handler::write(const char * data, size_t size) +{ + return my_fwrite(m_log_file, (uchar *) data, size, MYF(0)); +} + +void Audit_file_handler::handler_start() +{ + pthread_mutex_lock(&LOCK_io); + char format_name[FN_REFLEN]; + fn_format(format_name, m_filename, "", "", MY_UNPACK_FILENAME); + m_log_file = my_fopen(format_name, O_RDWR | O_APPEND, MYF(0)); + if (!m_log_file) + { + sql_print_error( + "%s unable to create %s: %s. audit file handler disabled!!", + AUDIT_LOG_PREFIX, m_filename, strerror(errno)); + m_enabled = false; + } + else + { + ssize_t res = m_formatter->start_msg_format(this); + /* + sanity check of writing to the log. If we fail. We will print an erorr and disable this handler. + */ + if (res < 0 || fflush(m_log_file) != 0) + { + sql_print_error( + "%s unable to write to %s: %s. Disabling audit handler.", + AUDIT_LOG_PREFIX, m_log_file, strerror(errno)); + close_file(); + m_enabled = false; + } + } + pthread_mutex_unlock(&LOCK_io); +} +void Audit_file_handler::handler_stop() +{ + pthread_mutex_lock(&LOCK_io); + m_formatter->stop_msg_format(this); + close_file(); + pthread_mutex_unlock(&LOCK_io); +} + +void Audit_file_handler::handler_log_audit(ThdSesData *pThdData) +{ + pthread_mutex_lock(&LOCK_io); + m_formatter->event_format(pThdData, this); + if (++m_sync_counter >= m_sync_period && m_sync_period) + { + m_sync_counter = 0; + //Note fflush() only flushes the user space buffers provided by the C library. + //To ensure that the data is physically stored on disk the kernel buffers must be flushed too, + //e.g. with sync(2) or fsync(2). + fflush(m_log_file); + int fd = fileno(m_log_file); + my_sync(fd, MYF(MY_WME)); + } + pthread_mutex_unlock(&LOCK_io); +} + +/////////////////// Audit_socket_handler ////////////////////////////////// + +ssize_t Audit_socket_handler::write(const char * data, size_t size) +{ + return vio_write((Vio*)m_vio, (const uchar *) data, size); +} + +void Audit_socket_handler::handler_start() +{ + pthread_mutex_lock(&LOCK_io); + //open the socket + int sock = socket(AF_UNIX,SOCK_STREAM,0); + if (sock < 0) + { + sql_print_error( + "%s unable to create socket: %s. audit socket handler disabled!!", + AUDIT_LOG_PREFIX, strerror(errno)); + m_enabled = false; + pthread_mutex_unlock(&LOCK_io); + return; + } + + //connect the socket + m_vio= vio_new(sock, VIO_TYPE_SOCKET, VIO_LOCALHOST); + struct sockaddr_un UNIXaddr; + UNIXaddr.sun_family = AF_UNIX; + strmake(UNIXaddr.sun_path, m_sockname, sizeof(UNIXaddr.sun_path)-1); + if (my_connect(sock,(struct sockaddr *) &UNIXaddr, sizeof(UNIXaddr), + m_connect_timeout)) + { + sql_print_error( + "%s unable to connect to socket: %s. err: %s. audit socket handler disabled!!", + AUDIT_LOG_PREFIX, m_sockname, strerror(errno)); + close_vio(); + m_enabled = false; + pthread_mutex_unlock(&LOCK_io); + return; + + } + ssize_t res = m_formatter->start_msg_format(this); + /* + sanity check of writing to the log. If we fail. We will print an erorr and disable this handler. + */ + if (res < 0) + { + sql_print_error( + "%s unable to write to %s: %s. Disabling audit handler.", + AUDIT_LOG_PREFIX, m_sockname, strerror(errno)); + close_vio(); + m_enabled = false; + } + pthread_mutex_unlock(&LOCK_io); +} +void Audit_socket_handler::handler_stop() +{ + pthread_mutex_lock(&LOCK_io); + m_formatter->stop_msg_format(this); + close_vio(); + pthread_mutex_unlock(&LOCK_io); +} + +void Audit_socket_handler::handler_log_audit(ThdSesData *pThdData) +{ + pthread_mutex_lock(&LOCK_io); + m_formatter->event_format(pThdData, this); + pthread_mutex_unlock(&LOCK_io); +} + +//////////////////////// Audit Socket handler end /////////////////////////////////////////// + + + + +static inline yajl_gen_status yajl_add_string(yajl_gen hand, const char * str) +{ + return yajl_gen_string(hand, (const unsigned char*)str, strlen(str)); +} + +static inline void yajl_add_string_val(yajl_gen hand, const char * name, const char* val) +{ + if(0 == val) + { + return; //we don't add NULL values to json + } + yajl_add_string(hand, name); + yajl_add_string(hand, val); +} + +static inline void yajl_add_string_val(yajl_gen hand, const char * name, const char* val, size_t val_len) +{ + yajl_add_string(hand, name); + yajl_gen_string(hand, (const unsigned char*)val, val_len); +} + +static inline void yajl_add_uint64(yajl_gen gen, const char * name, uint64 num) +{ + const size_t max_int64_str_len = 21; + char buf[max_int64_str_len]; + snprintf(buf, max_int64_str_len, "%llu", num); + yajl_add_string_val(gen, name, buf); +} +static inline void yajl_add_obj( yajl_gen gen, const char *db,const char* ptype,const char * name =NULL) +{ + yajl_add_string_val(gen, "db", db); + if (name) + { + yajl_add_string_val(gen, "name", name); + } + yajl_add_string_val(gen, "obj_type",ptype); +} + +//void Audit_file_handler::print_sleep (THD *thd, int delay_ms) +//{ +// +// unsigned long thdid = thd_get_thread_id(thd); +// yajl_gen gen = yajl_gen_alloc(&config, NULL); +// yajl_gen_array_open(gen); +// yajl_gen_map_open(gen); // yajl_add_string_val(gen, "msg-type", "activity"); -// uint64 ts = my_getsystime() / (10000); -// yajl_add_uint64(gen, "date", ts); +// uint64 ts = my_getsystime() / (10000); +// yajl_add_uint64(gen, "date", ts); // yajl_add_uint64(gen, "thread-id", thdid); // yajl_add_uint64(gen, "audit is going to sleep for ", delay_ms); // yajl_gen_map_close(gen); // yajl_gen_array_close(gen); -// fflush(m_log_file); -// int fd = fileno(m_log_file); +// fflush(m_log_file); +// int fd = fileno(m_log_file); // my_sync(fd, MYF(MY_WME)); -// -//} -ssize_t Audit_json_formatter::event_format(ThdSesData* pThdData, IWriter * writer) -{ - unsigned long thdid = thd_get_thread_id(pThdData->getTHD()); - query_id_t qid = thd_inst_query_id(pThdData->getTHD()); - int command = thd_inst_command(pThdData->getTHD()); - - - Security_context * sctx = thd_inst_main_security_ctx(pThdData->getTHD()); - - //initialize yajl - yajl_gen gen = yajl_gen_alloc(&config, NULL); - yajl_gen_map_open(gen); - yajl_add_string_val(gen, "msg-type", "activity"); - //TODO: get the start date from THD (but it is not in millis. Need to think about how we handle this) - //for now simply use the current time. - //my_getsystime() time since epoc in 100 nanosec units. Need to devide by 1000*(1000/100) to reach millis - uint64 ts = my_getsystime() / (10000); - yajl_add_uint64(gen, "date", ts); - yajl_add_uint64(gen, "thread-id", thdid); - yajl_add_uint64(gen, "query-id", qid); - yajl_add_string_val(gen, "user", sctx->user); - yajl_add_string_val(gen, "priv_user", sctx->priv_user); - yajl_add_string_val(gen, "host", sctx->host); - yajl_add_string_val(gen, "ip", sctx->ip); - const char *cmd = pThdData->getCmdName(); - //only print tables if lex is not null and it is not a quit command - LEX * pLex = Audit_formatter::thd_lex(pThdData->getTHD()); - QueryTableInf *pQuery_cache_table_list = getQueryCacheTableList1 (pThdData->getTHD()); - if (pLex && command != COM_QUIT && pLex->query_tables == NULL && pQuery_cache_table_list) - { - yajl_add_string_val(gen, "cmd", "select"); - yajl_add_string(gen, "objects"); - yajl_gen_array_open(gen); - for (int i=0;inum_of_elem && i < MAX_NUM_QUERY_TABLE_ELEM && pQuery_cache_table_list->num_of_elem >=0;i++) - { - yajl_gen_map_open(gen); - yajl_add_obj (gen, pQuery_cache_table_list->db[i],pQuery_cache_table_list->object_type[i],pQuery_cache_table_list->table_name[i] ); - yajl_gen_map_close(gen); - - } - yajl_gen_array_close(gen); - - } - else - { - - yajl_add_string_val(gen, "cmd", cmd); - } - - - if (strcmp (cmd,"Init DB") ==0 || strcmp (cmd, "SHOW TABLES")== 0 || strcmp (cmd, "SHOW TABLE")==0) - { - if ((pThdData->getTHD())->db !=0) - { - yajl_add_string(gen, "objects"); - yajl_gen_array_open(gen); - yajl_add_obj (gen,(pThdData->getTHD())->db,"database", NULL); - yajl_gen_array_close(gen); - } - } - - - if (pLex && command != COM_QUIT && pLex->query_tables) - { - yajl_add_string(gen, "objects"); - yajl_gen_array_open(gen); - TABLE_LIST * table = pLex->query_tables; - bool isFirstElementInView = true; - - while (table) - { - yajl_gen_map_open(gen); - if (isFirstElementInView && strstr (cmd,"_view")!=NULL ) - { - yajl_add_obj (gen,table->get_db_name(), "view",table->get_table_name()); - isFirstElementInView = false; - } - else - { - yajl_add_obj (gen,table->get_db_name(), retrive_object_type(table),table->get_table_name()); - } - yajl_gen_map_close(gen); - table = table->next_global; - } - yajl_gen_array_close(gen); - } - - - size_t qlen = 0; - - const char * query = thd_query(pThdData->getTHD(), &qlen); - if (query && qlen > 0) - { - CHARSET_INFO *col_connection = Item::default_charset(); - if (strcmp (col_connection->csname,"utf8")!=0) { - String sQuery (query,col_connection) ; - pThdData->getTHD()->convert_string (&sQuery,col_connection,&my_charset_utf8_general_ci); - yajl_add_string_val(gen, "query", sQuery.c_ptr_safe(), sQuery.length()); - } - else - { - yajl_add_string_val(gen, "query",query, qlen); - } - - } - else - { - if (cmd!=NULL && strlen (cmd)!=0) - { - yajl_add_string_val(gen, "query",cmd, strlen (cmd)); - } - else - { - yajl_add_string_val(gen, "query","n/a", strlen ("n/a" )); - } - } - ssize_t res = -2; - yajl_gen_status stat = yajl_gen_map_close(gen); //close the object - if(stat == yajl_gen_status_ok) //all is good write the buffer out - { - const unsigned char * text = NULL; - unsigned int len = 0; - yajl_gen_get_buf(gen, &text, &len); - //print the json - res = writer->write((const char *)text, len); - if(res >= 0) - { - //TODO: use the msg_delimiter - res = writer->write("\n", 1); - } - //my_fwrite(log_file, (uchar *) b.data, json_size(&b), MYF(0)); - } - yajl_gen_free(gen); //free the generator - return res; -} - - - - -ThdSesData::ThdSesData (THD *pTHD) : m_pThd (pTHD), m_CmdName(NULL) -{ - m_CmdName = retrieve_command (m_pThd); -} +// +//} +ssize_t Audit_json_formatter::event_format(ThdSesData* pThdData, IWriter * writer) +{ + unsigned long thdid = thd_get_thread_id(pThdData->getTHD()); + query_id_t qid = thd_inst_query_id(pThdData->getTHD()); + int command = thd_inst_command(pThdData->getTHD()); + + + Security_context * sctx = thd_inst_main_security_ctx(pThdData->getTHD()); + + //initialize yajl + yajl_gen gen = yajl_gen_alloc(&config, NULL); + yajl_gen_map_open(gen); + yajl_add_string_val(gen, "msg-type", "activity"); + //TODO: get the start date from THD (but it is not in millis. Need to think about how we handle this) + //for now simply use the current time. + //my_getsystime() time since epoc in 100 nanosec units. Need to devide by 1000*(1000/100) to reach millis + uint64 ts = my_getsystime() / (10000); + yajl_add_uint64(gen, "date", ts); + yajl_add_uint64(gen, "thread-id", thdid); + yajl_add_uint64(gen, "query-id", qid); + yajl_add_string_val(gen, "user", sctx->user); + yajl_add_string_val(gen, "priv_user", sctx->priv_user); + yajl_add_string_val(gen, "host", sctx->host); + yajl_add_string_val(gen, "ip", sctx->ip); + const char *cmd = pThdData->getCmdName(); + //only print tables if lex is not null and it is not a quit command + LEX * pLex = Audit_formatter::thd_lex(pThdData->getTHD()); + QueryTableInf *pQuery_cache_table_list = getQueryCacheTableList1 (pThdData->getTHD()); + if (pLex && command != COM_QUIT && pLex->query_tables == NULL && pQuery_cache_table_list) + { + yajl_add_string_val(gen, "cmd", "select"); + yajl_add_string(gen, "objects"); + yajl_gen_array_open(gen); + for (int i=0;inum_of_elem && i < MAX_NUM_QUERY_TABLE_ELEM && pQuery_cache_table_list->num_of_elem >=0;i++) + { + yajl_gen_map_open(gen); + yajl_add_obj (gen, pQuery_cache_table_list->db[i],pQuery_cache_table_list->object_type[i],pQuery_cache_table_list->table_name[i] ); + yajl_gen_map_close(gen); + + } + yajl_gen_array_close(gen); + + } + else + { + + yajl_add_string_val(gen, "cmd", cmd); + } + + + if (strcmp (cmd,"Init DB") ==0 || strcmp (cmd, "SHOW TABLES")== 0 || strcmp (cmd, "SHOW TABLE")==0) + { + if ((pThdData->getTHD())->db !=0) + { + yajl_add_string(gen, "objects"); + yajl_gen_array_open(gen); + yajl_add_obj (gen,(pThdData->getTHD())->db,"database", NULL); + yajl_gen_array_close(gen); + } + } + + + if (pLex && command != COM_QUIT && pLex->query_tables) + { + yajl_add_string(gen, "objects"); + yajl_gen_array_open(gen); + TABLE_LIST * table = pLex->query_tables; + bool isFirstElementInView = true; + + while (table) + { + yajl_gen_map_open(gen); + if (isFirstElementInView && strstr (cmd,"_view")!=NULL ) + { + yajl_add_obj (gen,table->get_db_name(), "view",table->get_table_name()); + isFirstElementInView = false; + } + else + { + yajl_add_obj (gen,table->get_db_name(), retrive_object_type(table),table->get_table_name()); + } + yajl_gen_map_close(gen); + table = table->next_global; + } + yajl_gen_array_close(gen); + } + + + size_t qlen = 0; + + const char * query = thd_query(pThdData->getTHD(), &qlen); + if (query && qlen > 0) + { + CHARSET_INFO *col_connection = Item::default_charset(); + if (strcmp (col_connection->csname,"utf8")!=0) { + String sQuery (query,col_connection) ; + pThdData->getTHD()->convert_string (&sQuery,col_connection,&my_charset_utf8_general_ci); + yajl_add_string_val(gen, "query", sQuery.c_ptr_safe(), sQuery.length()); + } + else + { + yajl_add_string_val(gen, "query",query, qlen); + } + + } + else + { + if (cmd!=NULL && strlen (cmd)!=0) + { + yajl_add_string_val(gen, "query",cmd, strlen (cmd)); + } + else + { + yajl_add_string_val(gen, "query","n/a", strlen ("n/a" )); + } + } + ssize_t res = -2; + yajl_gen_status stat = yajl_gen_map_close(gen); //close the object + if(stat == yajl_gen_status_ok) //all is good write the buffer out + { + const unsigned char * text = NULL; + unsigned int len = 0; + yajl_gen_get_buf(gen, &text, &len); + //print the json + res = writer->write((const char *)text, len); + if(res >= 0) + { + //TODO: use the msg_delimiter + res = writer->write("\n", 1); + } + //my_fwrite(log_file, (uchar *) b.data, json_size(&b), MYF(0)); + } + yajl_gen_free(gen); //free the generator + return res; +} + + + + +ThdSesData::ThdSesData (THD *pTHD) : m_pThd (pTHD), m_CmdName(NULL) +{ + m_CmdName = retrieve_command (m_pThd); +} diff --git a/src/audit_plugin.cc b/src/audit_plugin.cc old mode 100755 new mode 100644 index 0d71a7c..4547014 --- a/src/audit_plugin.cc +++ b/src/audit_plugin.cc @@ -36,66 +36,68 @@ static const ThdOffsets thd_offsets_arr[] = { //DISTRIBUTION: rpm - //offsets for: mysqlrpm/5.1.30/usr/sbin/mysqld (5.1.30-community) - {"5.1.30-community","8e43bda3644a883d46a1d064304b4f1d", 6184, 6248, 3656, 3928, 88, 2048}, - //offsets for: mysqlrpm/5.1.31/usr/sbin/mysqld (5.1.31-community) - {"5.1.31-community","540d4cf28ea559a0edea0ee971c9a107", 6192, 6256, 3664, 3936, 88, 2040}, - //offsets for: mysqlrpm/5.1.32/usr/sbin/mysqld (5.1.32-community) - {"5.1.32-community","b75c7d571e9d12b8c37ceafb9042c987", 6192, 6256, 3664, 3936, 88, 2040}, - //offsets for: mysqlrpm/5.1.33/usr/sbin/mysqld (5.1.33-community) - {"5.1.33-community","56e820a385ff22f732e0638aa262b447", 6192, 6256, 3664, 3936, 88, 2048}, - //offsets for: mysqlrpm/5.1.34/usr/sbin/mysqld (5.1.34-community) - {"5.1.34-community","da3c0f88578725356b04e7631591bef3", 6200, 6264, 3672, 3944, 88, 2048}, - //offsets for: mysqlrpm/5.1.35/usr/sbin/mysqld (5.1.35-community) - {"5.1.35-community","c2676c2496fea6741ebd5df7cf7ce444", 6200, 6264, 3672, 3944, 88, 2048}, - //offsets for: mysqlrpm/5.1.36/usr/sbin/mysqld (5.1.36-community) - {"5.1.36-community","3de797ee36be61a8221a6093eb9c649e", 6200, 6264, 3672, 3944, 88, 2048}, - //offsets for: mysqlrpm/5.1.37/usr/sbin/mysqld (5.1.37-community) - {"5.1.37-community","508ffea25280c9454dcef065e5fd4af2", 6200, 6264, 3672, 3944, 88, 2048}, - //offsets for: mysqlrpm/5.1.38/usr/sbin/mysqld (5.1.38-community) - {"5.1.38-community","3bf0d4cc9fded79b76e5467c1b5dac82", 6200, 6264, 3672, 3944, 88, 2048}, - //offsets for: mysqlrpm/5.1.39/usr/sbin/mysqld (5.1.39-community) - {"5.1.39-community","deca5ca3813a9d4157f37f5280be8a26", 6200, 6264, 3672, 3944, 88, 2048}, - //offsets for: mysqlrpm/5.1.40/usr/sbin/mysqld (5.1.40-community) - {"5.1.40-community","6ce779a6883b69a1ba28ca5640e60a55", 6200, 6264, 3672, 3944, 88, 2048}, - {"5.1.40-community","2fa8842d7685c8c7d4a1cdd8533d7f62", 6200, 6264, 3672, 3944, 88, 2048}, - //offsets for: mysqlrpm/5.1.41/usr/sbin/mysqld (5.1.41-community) - {"5.1.41-community","6ccf4357688d8e46bfcb4443966970b0", 6200, 6264, 3672, 3944, 88, 2048}, - //offsets for: mysqlrpm/5.1.42/usr/sbin/mysqld (5.1.42-community) - {"5.1.42-community","8dd9f47e0998958d8826aa2a2487114e", 6200, 6264, 3672, 3944, 88, 2048}, - //offsets for: mysqlrpm/5.1.43/usr/sbin/mysqld (5.1.43-community) - {"5.1.43-community","bcd73a2b710327861608fc3d3464f8df", 6200, 6264, 3672, 3944, 88, 2048}, - //offsets for: mysqlrpm/5.1.44/usr/sbin/mysqld (5.1.44-community) - {"5.1.44-community","e059b94720daa145d9807a33e9c450b9", 6208, 6272, 3680, 3952, 88, 2048}, - //offsets for: mysqlrpm/5.1.45/usr/sbin/mysqld (5.1.45-community) - {"5.1.45-community","7f681b9441bf05f20c4b1b5e7f580269", 6208, 6272, 3680, 3952, 88, 2048}, - //offsets for: mysqlrpm/5.1.46/usr/sbin/mysqld (5.1.46-community) - {"5.1.46-community","7e16a80f8593ce5dc65042101c572b9c", 6208, 6272, 3680, 3952, 88, 2048}, - //offsets for: mysqlrpm/5.1.47/usr/sbin/mysqld (5.1.47-community) - {"5.1.47-community","8a4de4573d4037cc27adf45ab7275544", 6336, 6400, 3688, 3960, 88, 2048}, - //offsets for: mysqlrpm/5.1.48/usr/sbin/mysqld (5.1.48-community) - {"5.1.48-community","10ac2c73ff9476752f15c5658bc3d5ce", 6336, 6400, 3688, 3960, 88, 2048}, - //offsets for: mysqlrpm/5.1.49/usr/sbin/mysqld (5.1.49-community) - {"5.1.49-community","85c8cd6984de26580ddf49d87ea76c43", 6336, 6400, 3688, 3960, 88, 2048}, - //offsets for: mysqlrpm/5.1.50/usr/sbin/mysqld (5.1.50-community) - {"5.1.50-community","174ce50cfc926bfb04701acdd1d7489d", 6336, 6400, 3688, 3960, 88, 2048}, - //offsets for: mysqlrpm/5.1.51/usr/sbin/mysqld (5.1.51-community) - {"5.1.51-community","4ebe71217f34c38fc80c8aa2c4ddcca8", 6336, 6400, 3688, 3960, 88, 2048}, - //offsets for: mysqlrpm/5.1.52/usr/sbin/mysqld (5.1.52-community) - {"5.1.52-community","bbb6ca9baf04a4c596e53c49a1e34589", 6336, 6400, 3688, 3960, 88, 2048}, - //offsets for: mysqlrpm/5.1.53/usr/sbin/mysqld (5.1.53-community) - {"5.1.53-community","90d9cd7d6c2793e31e42aaa378dbe044", 6336, 6400, 3688, 3960, 88, 2048}, - //offsets for: mysqlrpm/5.1.54/usr/sbin/mysqld (5.1.54-community) - {"5.1.54-community","c23b86ac2f64e9de6731fef97e79c98e", 6336, 6400, 3688, 3960, 88, 2048}, - //offsets for: mysqlrpm/5.1.55/usr/sbin/mysqld (5.1.55-community) - {"5.1.55-community","e5d0694364a5e14dd227cb3c28ea0928", 6336, 6400, 3688, 3960, 88, 2048}, - //offsets for: mysqlrpm/5.1.56/usr/sbin/mysqld (5.1.56-community) - {"5.1.56-community","fd16157ab06cc0cfb3eba40e9936792c", 6336, 6400, 3688, 3960, 88, 2048}, - //offsets for: mysqlrpm/5.1.57/usr/sbin/mysqld (5.1.57-community) - {"5.1.57-community","4c6d32f80c20657983f7ac316c6a6e10", 6336, 6400, 3688, 3960, 88, 2048}, - //offsets for: mysqlrpm/5.1.58/usr/sbin/mysqld (5.1.58-community) - {"5.1.58-community","e42752084a90c708a94779d26589b748", 6336, 6400, 3688, 3960, 88, 2048}, - {"5.1.58-community","032d4f14464851e724281f8b692578a2", 6336, 6400, 3688, 3960, 88, 2048}, + //offsets for: mysqlrpm/5.1.30/usr/sbin/mysqld (5.1.30-community) + {"5.1.30-community","8e43bda3644a883d46a1d064304b4f1d", 6184, 6248, 3656, 3928, 88, 2048}, + //offsets for: mysqlrpm/5.1.31/usr/sbin/mysqld (5.1.31-community) + {"5.1.31-community","540d4cf28ea559a0edea0ee971c9a107", 6192, 6256, 3664, 3936, 88, 2040}, + //offsets for: mysqlrpm/5.1.32/usr/sbin/mysqld (5.1.32-community) + {"5.1.32-community","b75c7d571e9d12b8c37ceafb9042c987", 6192, 6256, 3664, 3936, 88, 2040}, + //offsets for: mysqlrpm/5.1.33/usr/sbin/mysqld (5.1.33-community) + {"5.1.33-community","56e820a385ff22f732e0638aa262b447", 6192, 6256, 3664, 3936, 88, 2048}, + //offsets for: mysqlrpm/5.1.34/usr/sbin/mysqld (5.1.34-community) + {"5.1.34-community","da3c0f88578725356b04e7631591bef3", 6200, 6264, 3672, 3944, 88, 2048}, + //offsets for: mysqlrpm/5.1.35/usr/sbin/mysqld (5.1.35-community) + {"5.1.35-community","c2676c2496fea6741ebd5df7cf7ce444", 6200, 6264, 3672, 3944, 88, 2048}, + //offsets for: mysqlrpm/5.1.36/usr/sbin/mysqld (5.1.36-community) + {"5.1.36-community","3de797ee36be61a8221a6093eb9c649e", 6200, 6264, 3672, 3944, 88, 2048}, + //offsets for: mysqlrpm/5.1.37/usr/sbin/mysqld (5.1.37-community) + {"5.1.37-community","508ffea25280c9454dcef065e5fd4af2", 6200, 6264, 3672, 3944, 88, 2048}, + //offsets for: mysqlrpm/5.1.38/usr/sbin/mysqld (5.1.38-community) + {"5.1.38-community","3bf0d4cc9fded79b76e5467c1b5dac82", 6200, 6264, 3672, 3944, 88, 2048}, + //offsets for: mysqlrpm/5.1.39/usr/sbin/mysqld (5.1.39-community) + {"5.1.39-community","deca5ca3813a9d4157f37f5280be8a26", 6200, 6264, 3672, 3944, 88, 2048}, + //offsets for: mysqlrpm/5.1.40/usr/sbin/mysqld (5.1.40-community) + {"5.1.40-community","6ce779a6883b69a1ba28ca5640e60a55", 6200, 6264, 3672, 3944, 88, 2048}, + {"5.1.40-community","2fa8842d7685c8c7d4a1cdd8533d7f62", 6200, 6264, 3672, 3944, 88, 2048}, + //offsets for: mysqlrpm/5.1.41/usr/sbin/mysqld (5.1.41-community) + {"5.1.41-community","6ccf4357688d8e46bfcb4443966970b0", 6200, 6264, 3672, 3944, 88, 2048}, + //offsets for: mysqlrpm/5.1.42/usr/sbin/mysqld (5.1.42-community) + {"5.1.42-community","8dd9f47e0998958d8826aa2a2487114e", 6200, 6264, 3672, 3944, 88, 2048}, + //offsets for: mysqlrpm/5.1.43/usr/sbin/mysqld (5.1.43-community) + {"5.1.43-community","bcd73a2b710327861608fc3d3464f8df", 6200, 6264, 3672, 3944, 88, 2048}, + //offsets for: mysqlrpm/5.1.44/usr/sbin/mysqld (5.1.44-community) + {"5.1.44-community","e059b94720daa145d9807a33e9c450b9", 6208, 6272, 3680, 3952, 88, 2048}, + //offsets for: mysqlrpm/5.1.45/usr/sbin/mysqld (5.1.45-community) + {"5.1.45-community","7f681b9441bf05f20c4b1b5e7f580269", 6208, 6272, 3680, 3952, 88, 2048}, + //offsets for: mysqlrpm/5.1.46/usr/sbin/mysqld (5.1.46-community) + {"5.1.46-community","7e16a80f8593ce5dc65042101c572b9c", 6208, 6272, 3680, 3952, 88, 2048}, + //offsets for: mysqlrpm/5.1.47/usr/sbin/mysqld (5.1.47-community) + {"5.1.47-community","8a4de4573d4037cc27adf45ab7275544", 6336, 6400, 3688, 3960, 88, 2048}, + //offsets for: mysqlrpm/5.1.48/usr/sbin/mysqld (5.1.48-community) + {"5.1.48-community","10ac2c73ff9476752f15c5658bc3d5ce", 6336, 6400, 3688, 3960, 88, 2048}, + //offsets for: mysqlrpm/5.1.49/usr/sbin/mysqld (5.1.49-community) + {"5.1.49-community","85c8cd6984de26580ddf49d87ea76c43", 6336, 6400, 3688, 3960, 88, 2048}, + //offsets for: mysqlrpm/5.1.50/usr/sbin/mysqld (5.1.50-community) + {"5.1.50-community","174ce50cfc926bfb04701acdd1d7489d", 6336, 6400, 3688, 3960, 88, 2048}, + //offsets for: mysqlrpm/5.1.51/usr/sbin/mysqld (5.1.51-community) + {"5.1.51-community","4ebe71217f34c38fc80c8aa2c4ddcca8", 6336, 6400, 3688, 3960, 88, 2048}, + //offsets for: mysqlrpm/5.1.52/usr/sbin/mysqld (5.1.52-community) + {"5.1.52-community","bbb6ca9baf04a4c596e53c49a1e34589", 6336, 6400, 3688, 3960, 88, 2048}, + //offsets for: mysqlrpm/5.1.53/usr/sbin/mysqld (5.1.53-community) + {"5.1.53-community","90d9cd7d6c2793e31e42aaa378dbe044", 6336, 6400, 3688, 3960, 88, 2048}, + //offsets for: mysqlrpm/5.1.54/usr/sbin/mysqld (5.1.54-community) + {"5.1.54-community","c23b86ac2f64e9de6731fef97e79c98e", 6336, 6400, 3688, 3960, 88, 2048}, + //offsets for: mysqlrpm/5.1.55/usr/sbin/mysqld (5.1.55-community) + {"5.1.55-community","e5d0694364a5e14dd227cb3c28ea0928", 6336, 6400, 3688, 3960, 88, 2048}, + //offsets for: mysqlrpm/5.1.56/usr/sbin/mysqld (5.1.56-community) + {"5.1.56-community","fd16157ab06cc0cfb3eba40e9936792c", 6336, 6400, 3688, 3960, 88, 2048}, + //offsets for: /usr/sbin/mysqld (5.1.56-ndb-7.1.18-cluster-gpl) + {"5.1.56-ndb-7.1.18-cluster-gpl","ee9cc4dd2f0e9db04dce32867fcf599e", 6304, 6368, 3640, 3912, 88, 2048}, + //offsets for: mysqlrpm/5.1.57/usr/sbin/mysqld (5.1.57-community) + {"5.1.57-community","4c6d32f80c20657983f7ac316c6a6e10", 6336, 6400, 3688, 3960, 88, 2048}, + //offsets for: mysqlrpm/5.1.58/usr/sbin/mysqld (5.1.58-community) + {"5.1.58-community","e42752084a90c708a94779d26589b748", 6336, 6400, 3688, 3960, 88, 2048}, + {"5.1.58-community","032d4f14464851e724281f8b692578a2", 6336, 6400, 3688, 3960, 88, 2048}, //offsets for: /usr/sbin/mysqld (5.1.58-community) {"5.1.58-community","7c51a8f1aabece893982e0cafac8dcee", 6336, 6400, 3688, 3960, 88, 2048}, //offsets for: /mysqlrpm/5.1.59/usr/sbin/mysqld (5.1.59-community) @@ -107,36 +109,36 @@ static const ThdOffsets thd_offsets_arr[] = //offsets for: /mysqlrpm/5.1.62/usr/sbin/mysqld (5.1.62-community) {"5.1.62-community","a4e8de89e0d9a353d09687d3b4560cb3", 6328, 6392, 3688, 3960, 88, 2048}, //offsets for: /mysqlrpm/5.1.63/usr/sbin/mysqld (5.1.63-community) - {"5.1.63-community","0f4d7e3b17eb36f17aafe4360993a769", 6328, 6392, 3688, 3960, 88, 2048}, - //offsets for: mysqlrpm/5.5.8/usr/sbin/mysqld (5.5.8) - {"5.5.8","70a882693d54df8ab7c7d9f256e317bb", 6032, 6080, 3776, 4200, 88, 2560}, - //offsets for: mysqlrpm/5.5.9/usr/sbin/mysqld (5.5.9) - {"5.5.9","262554c75df0b890e08c5c2500391342", 6056, 6104, 3800, 4224, 88, 2560}, - //offsets for: mysqlrpm/5.5.10/usr/sbin/mysqld (5.5.10) - {"5.5.10","f9d15e7ff70ad177923b9d2a14b9bc19", 6056, 6104, 3800, 4224, 88, 2560}, - //offsets for: mysqlrpm/5.5.11/usr/sbin/mysqld (5.5.11) - {"5.5.11","04a7049ba1c099e00dcdc6f1d98078aa", 6048, 6096, 3792, 4216, 88, 2560}, - //offsets for: mysqlrpm/5.5.12/usr/sbin/mysqld (5.5.12) - {"5.5.12","91df7918803df78b164f46706003e22d", 6048, 6096, 3792, 4216, 88, 2560}, - //offsets for: mysqlrpm/5.5.13/usr/sbin/mysqld (5.5.13) - {"5.5.13","f13cbe2c1a5247c52d592ac199b8d9af", 6048, 6096, 3792, 4216, 88, 2560}, - //offsets for: mysqlrpm/5.5.14/usr/sbin/mysqld (5.5.14) - {"5.5.14","4fb94eac7eaa2dc9bbf3ee773a54197e", 6048, 6096, 3792, 4216, 88, 2560}, - {"5.5.15-debug", "", 6256, 6304, 3992, 4424, 88, 2560}, - //offsets for: mysqlrpm/5.5.15/usr/sbin/mysqld (5.5.15) - {"5.5.15","d3c2a51a84cbec77c2fb92f1ea414ec3", 6048, 6096, 3792, 4216, 88, 2560}, - //offsets for: mysqlrpm/5.5.16/usr/sbin/mysqld (5.5.16) - {"5.5.16","289c64d14b132c67fd22cd6404817bc3", 6040, 6088, 3792, 4216, 88, 2560}, - //offsets for: mysqlrpm/5.5.17/usr/sbin/mysqld (5.5.17) - {"5.5.17","9c6b2f65b1015f924fb74408d2968339", 6040, 6088, 3792, 4216, 88, 2560}, - //offsets for: mysqlrpm/5.5.18/usr/sbin/mysqld (5.5.18) - {"5.5.18","60d191bfeea1232e86fa4ad54ae46b10", 6040, 6088, 3792, 4216, 88, 2560}, - {"5.5.18","099d31c0cd0754934b84c17f683d019e", 6040, 6088, 3792, 4216, 88, 2560}, - //offsets for: mysqlrpm/5.5.19/usr/sbin/mysqld (5.5.19) - {"5.5.19","0765dadb23315bb076bc6e21cfb2de40", 6048, 6096, 3800, 4224, 88, 2560}, - //offsets for: /mysqlrpm/5.5.20/usr/sbin/mysqld (5.5.20) - {"5.5.20","9f6122576930c5d09ca9244094c83f24", 6048, 6096, 3800, 4224, 88, 2560}, - //offsets for: mysqlrpm/5.5.21/usr/sbin/mysqld (5.5.21) + {"5.1.63-community","0f4d7e3b17eb36f17aafe4360993a769", 6328, 6392, 3688, 3960, 88, 2048}, + //offsets for: mysqlrpm/5.5.8/usr/sbin/mysqld (5.5.8) + {"5.5.8","70a882693d54df8ab7c7d9f256e317bb", 6032, 6080, 3776, 4200, 88, 2560}, + //offsets for: mysqlrpm/5.5.9/usr/sbin/mysqld (5.5.9) + {"5.5.9","262554c75df0b890e08c5c2500391342", 6056, 6104, 3800, 4224, 88, 2560}, + //offsets for: mysqlrpm/5.5.10/usr/sbin/mysqld (5.5.10) + {"5.5.10","f9d15e7ff70ad177923b9d2a14b9bc19", 6056, 6104, 3800, 4224, 88, 2560}, + //offsets for: mysqlrpm/5.5.11/usr/sbin/mysqld (5.5.11) + {"5.5.11","04a7049ba1c099e00dcdc6f1d98078aa", 6048, 6096, 3792, 4216, 88, 2560}, + //offsets for: mysqlrpm/5.5.12/usr/sbin/mysqld (5.5.12) + {"5.5.12","91df7918803df78b164f46706003e22d", 6048, 6096, 3792, 4216, 88, 2560}, + //offsets for: mysqlrpm/5.5.13/usr/sbin/mysqld (5.5.13) + {"5.5.13","f13cbe2c1a5247c52d592ac199b8d9af", 6048, 6096, 3792, 4216, 88, 2560}, + //offsets for: mysqlrpm/5.5.14/usr/sbin/mysqld (5.5.14) + {"5.5.14","4fb94eac7eaa2dc9bbf3ee773a54197e", 6048, 6096, 3792, 4216, 88, 2560}, + {"5.5.15-debug", "", 6256, 6304, 3992, 4424, 88, 2560}, + //offsets for: mysqlrpm/5.5.15/usr/sbin/mysqld (5.5.15) + {"5.5.15","d3c2a51a84cbec77c2fb92f1ea414ec3", 6048, 6096, 3792, 4216, 88, 2560}, + //offsets for: mysqlrpm/5.5.16/usr/sbin/mysqld (5.5.16) + {"5.5.16","289c64d14b132c67fd22cd6404817bc3", 6040, 6088, 3792, 4216, 88, 2560}, + //offsets for: mysqlrpm/5.5.17/usr/sbin/mysqld (5.5.17) + {"5.5.17","9c6b2f65b1015f924fb74408d2968339", 6040, 6088, 3792, 4216, 88, 2560}, + //offsets for: mysqlrpm/5.5.18/usr/sbin/mysqld (5.5.18) + {"5.5.18","60d191bfeea1232e86fa4ad54ae46b10", 6040, 6088, 3792, 4216, 88, 2560}, + {"5.5.18","099d31c0cd0754934b84c17f683d019e", 6040, 6088, 3792, 4216, 88, 2560}, + //offsets for: mysqlrpm/5.5.19/usr/sbin/mysqld (5.5.19) + {"5.5.19","0765dadb23315bb076bc6e21cfb2de40", 6048, 6096, 3800, 4224, 88, 2560}, + //offsets for: /mysqlrpm/5.5.20/usr/sbin/mysqld (5.5.20) + {"5.5.20","9f6122576930c5d09ca9244094c83f24", 6048, 6096, 3800, 4224, 88, 2560}, + //offsets for: mysqlrpm/5.5.21/usr/sbin/mysqld (5.5.21) {"5.5.21","4a03ad064ed393dabdde175f3ea05ff2", 6048, 6096, 3800, 4224, 88, 2560}, //offsets for: mysqlrpm/5.5.22/usr/sbin/mysqld (5.5.22) {"5.5.22","f3592147108e65d92cb18fb4d900c4ab", 6048, 6096, 3800, 4224, 88, 2560}, @@ -147,110 +149,110 @@ static const ThdOffsets thd_offsets_arr[] = //offsets for: /mysqlrpm/5.5.25/usr/sbin/mysqld (5.5.25) {"5.5.25","6043eff2cfa493d4e020cae65c41b030", 6056, 6104, 3808, 4232, 88, 2568}, //offsets for: mysqlrpm/5.5.25a/usr/sbin/mysqld (5.5.25a) - {"5.5.25a","b59c03244daf51d4327409288d8c889f", 6056, 6104, 3808, 4232, 88, 2568}, + {"5.5.25a","b59c03244daf51d4327409288d8c889f", 6056, 6104, 3808, 4232, 88, 2568}, //DISTRIBUTION: tar.gz - //offsets for: /mysql/5.1.30/bin/mysqld (5.1.30) - {"5.1.30","b301b32be659367c1a1900b47534fd59", 6192, 6256, 3664, 3936, 88, 2048}, - //offsets for: /mysql/5.1.31/bin/mysqld (5.1.31) - {"5.1.31","2d8be9bf479678b3f2bd3214f1f04c7e", 6200, 6264, 3672, 3944, 88, 2040}, - //offsets for: /mysql/5.1.32/bin/mysqld (5.1.32) - {"5.1.32","c585253cf70944471c936962a318a81a", 6200, 6264, 3672, 3944, 88, 2040}, - //offsets for: /mysql/5.1.33/bin/mysqld (5.1.33) - {"5.1.33","99d8cbc22dc2919abe530ed61a52c89d", 6200, 6264, 3672, 3944, 88, 2048}, - //offsets for: /mysql/5.1.34/bin/mysqld (5.1.34) - {"5.1.34","47b8eb2e619dd953e4ce6cf468a19c6e", 6208, 6272, 3680, 3952, 88, 2048}, - //offsets for: /mysql/5.1.35/bin/mysqld (5.1.35) - {"5.1.35","950a25d0a4e4e100b72d60ffd451e93a", 6208, 6272, 3680, 3952, 88, 2048}, - //offsets for: /mysql/5.1.36/bin/mysqld (5.1.36) - {"5.1.36","758c2ac0375425a43cd815d3a2c10132", 6208, 6272, 3680, 3952, 88, 2048}, - //offsets for: /mysql/5.1.37/bin/mysqld (5.1.37) - {"5.1.37","4e7bfc2705eea482a19b710944dc5ff5", 6208, 6272, 3680, 3952, 88, 2048}, - //offsets for: /mysql/5.1.38/bin/mysqld (5.1.38) - {"5.1.38","09e8ac98651439fd4f22b508178cd0ef", 6208, 6272, 3680, 3952, 88, 2048}, - //offsets for: /mysql/5.1.39/bin/mysqld (5.1.39) - {"5.1.39","b6c4acb0a9a4ff71ab5e26ed010d20c9", 6208, 6272, 3680, 3952, 88, 2048}, - //offsets for: /mysql/5.1.40/bin/mysqld (5.1.40) - {"5.1.40","bc663cdf0a8411526dc9eb44dff5773f", 6208, 6272, 3680, 3952, 88, 2048}, - //offsets for: /mysql/5.1.41/bin/mysqld (5.1.41) - {"5.1.41","ebf47135d6fe9099cd62db1dea2c4ca6", 6208, 6272, 3680, 3952, 88, 2048}, - //offsets for: /mysql/5.1.42/bin/mysqld (5.1.42) - {"5.1.42","a7b55239789304978d8250697a3c73fc", 6208, 6272, 3680, 3952, 88, 2048}, - //offsets for: /mysql/5.1.43/bin/mysqld (5.1.43) - {"5.1.43","96e95d0b1461f4484e571af01c01bc4a", 6208, 6272, 3680, 3952, 88, 2048}, - //offsets for: /mysql/5.1.44/bin/mysqld (5.1.44) - {"5.1.44","ecf6919ce6d4e74d108644ab122ff1fb", 6216, 6280, 3688, 3960, 88, 2048}, - //offsets for: /mysql/5.1.45/bin/mysqld (5.1.45) - {"5.1.45","657c7e712a894ebe3b3db9b26cc3ebd7", 6216, 6280, 3688, 3960, 88, 2048}, - //offsets for: /mysql/5.1.46/bin/mysqld (5.1.46) - {"5.1.46","990b3bafe5d55dc1a9084791623191ca", 6216, 6280, 3688, 3960, 88, 2048}, - //offsets for: /mysql/5.1.47/bin/mysqld (5.1.47) - {"5.1.47","9868b07a44f8d5de8bc5716e3f680139", 6344, 6408, 3696, 3968, 88, 2048}, - //offsets for: /mysql/5.1.48/bin/mysqld (5.1.48) - {"5.1.48","e812133194ff8e0cd25945c327e07f6c", 6344, 6408, 3696, 3968, 88, 2048}, - //offsets for: /mysql/5.1.49/bin/mysqld (5.1.49) - {"5.1.49","4869d51b5bfc38f7698059e2696a95ca", 6344, 6408, 3696, 3968, 88, 2048}, - //offsets for: /mysql/5.1.50/bin/mysqld (5.1.50) - {"5.1.50","316a6b674d66cb151bac384cb0508357", 6344, 6408, 3696, 3968, 88, 2048}, - //offsets for: /mysql/5.1.51/bin/mysqld (5.1.51) - {"5.1.51","b9f831f698cd7fa85abe112bb99c8861", 6344, 6408, 3696, 3968, 88, 2048}, - //offsets for: /mysql/5.1.52/bin/mysqld (5.1.52) - {"5.1.52","c31f9c5d042e8793b3f192fa04f0e628", 6344, 6408, 3696, 3968, 88, 2048}, - //offsets for: /mysql/5.1.53/bin/mysqld (5.1.53) - {"5.1.53","07a3ae20e262306e708760889ff2705b", 6344, 6408, 3696, 3968, 88, 2048}, - //offsets for: /mysql/5.1.54/bin/mysqld (5.1.54) - {"5.1.54","9fca5d956c33e646920e68c541aabcae", 6344, 6408, 3696, 3968, 88, 2048}, - //offsets for: /mysql/5.1.55/bin/mysqld (5.1.55) - {"5.1.55","54457f3bc49d7ac7497f4212538c8ddc", 6344, 6408, 3696, 3968, 88, 2048}, - //offsets for: /mysql/5.1.56/bin/mysqld (5.1.56) - {"5.1.56","1a901cb4c1ff55aeab04ba4ba9e5f4ec", 6344, 6408, 3696, 3968, 88, 2048}, - //offsets for: /mysql/5.1.57/bin/mysqld (5.1.57) - {"5.1.57","c3c4f7c4403e501b11c532fb4eccf68b", 6344, 6408, 3696, 3968, 88, 2048}, - //offsets for: /mysql/5.1.58/bin/mysqld (5.1.58) - {"5.1.58","3e93f9d332fb8e3b9481f4620361f481", 6344, 6408, 3696, 3968, 88, 2048}, + //offsets for: /mysql/5.1.30/bin/mysqld (5.1.30) + {"5.1.30","b301b32be659367c1a1900b47534fd59", 6192, 6256, 3664, 3936, 88, 2048}, + //offsets for: /mysql/5.1.31/bin/mysqld (5.1.31) + {"5.1.31","2d8be9bf479678b3f2bd3214f1f04c7e", 6200, 6264, 3672, 3944, 88, 2040}, + //offsets for: /mysql/5.1.32/bin/mysqld (5.1.32) + {"5.1.32","c585253cf70944471c936962a318a81a", 6200, 6264, 3672, 3944, 88, 2040}, + //offsets for: /mysql/5.1.33/bin/mysqld (5.1.33) + {"5.1.33","99d8cbc22dc2919abe530ed61a52c89d", 6200, 6264, 3672, 3944, 88, 2048}, + //offsets for: /mysql/5.1.34/bin/mysqld (5.1.34) + {"5.1.34","47b8eb2e619dd953e4ce6cf468a19c6e", 6208, 6272, 3680, 3952, 88, 2048}, + //offsets for: /mysql/5.1.35/bin/mysqld (5.1.35) + {"5.1.35","950a25d0a4e4e100b72d60ffd451e93a", 6208, 6272, 3680, 3952, 88, 2048}, + //offsets for: /mysql/5.1.36/bin/mysqld (5.1.36) + {"5.1.36","758c2ac0375425a43cd815d3a2c10132", 6208, 6272, 3680, 3952, 88, 2048}, + //offsets for: /mysql/5.1.37/bin/mysqld (5.1.37) + {"5.1.37","4e7bfc2705eea482a19b710944dc5ff5", 6208, 6272, 3680, 3952, 88, 2048}, + //offsets for: /mysql/5.1.38/bin/mysqld (5.1.38) + {"5.1.38","09e8ac98651439fd4f22b508178cd0ef", 6208, 6272, 3680, 3952, 88, 2048}, + //offsets for: /mysql/5.1.39/bin/mysqld (5.1.39) + {"5.1.39","b6c4acb0a9a4ff71ab5e26ed010d20c9", 6208, 6272, 3680, 3952, 88, 2048}, + //offsets for: /mysql/5.1.40/bin/mysqld (5.1.40) + {"5.1.40","bc663cdf0a8411526dc9eb44dff5773f", 6208, 6272, 3680, 3952, 88, 2048}, + //offsets for: /mysql/5.1.41/bin/mysqld (5.1.41) + {"5.1.41","ebf47135d6fe9099cd62db1dea2c4ca6", 6208, 6272, 3680, 3952, 88, 2048}, + //offsets for: /mysql/5.1.42/bin/mysqld (5.1.42) + {"5.1.42","a7b55239789304978d8250697a3c73fc", 6208, 6272, 3680, 3952, 88, 2048}, + //offsets for: /mysql/5.1.43/bin/mysqld (5.1.43) + {"5.1.43","96e95d0b1461f4484e571af01c01bc4a", 6208, 6272, 3680, 3952, 88, 2048}, + //offsets for: /mysql/5.1.44/bin/mysqld (5.1.44) + {"5.1.44","ecf6919ce6d4e74d108644ab122ff1fb", 6216, 6280, 3688, 3960, 88, 2048}, + //offsets for: /mysql/5.1.45/bin/mysqld (5.1.45) + {"5.1.45","657c7e712a894ebe3b3db9b26cc3ebd7", 6216, 6280, 3688, 3960, 88, 2048}, + //offsets for: /mysql/5.1.46/bin/mysqld (5.1.46) + {"5.1.46","990b3bafe5d55dc1a9084791623191ca", 6216, 6280, 3688, 3960, 88, 2048}, + //offsets for: /mysql/5.1.47/bin/mysqld (5.1.47) + {"5.1.47","9868b07a44f8d5de8bc5716e3f680139", 6344, 6408, 3696, 3968, 88, 2048}, + //offsets for: /mysql/5.1.48/bin/mysqld (5.1.48) + {"5.1.48","e812133194ff8e0cd25945c327e07f6c", 6344, 6408, 3696, 3968, 88, 2048}, + //offsets for: /mysql/5.1.49/bin/mysqld (5.1.49) + {"5.1.49","4869d51b5bfc38f7698059e2696a95ca", 6344, 6408, 3696, 3968, 88, 2048}, + //offsets for: /mysql/5.1.50/bin/mysqld (5.1.50) + {"5.1.50","316a6b674d66cb151bac384cb0508357", 6344, 6408, 3696, 3968, 88, 2048}, + //offsets for: /mysql/5.1.51/bin/mysqld (5.1.51) + {"5.1.51","b9f831f698cd7fa85abe112bb99c8861", 6344, 6408, 3696, 3968, 88, 2048}, + //offsets for: /mysql/5.1.52/bin/mysqld (5.1.52) + {"5.1.52","c31f9c5d042e8793b3f192fa04f0e628", 6344, 6408, 3696, 3968, 88, 2048}, + //offsets for: /mysql/5.1.53/bin/mysqld (5.1.53) + {"5.1.53","07a3ae20e262306e708760889ff2705b", 6344, 6408, 3696, 3968, 88, 2048}, + //offsets for: /mysql/5.1.54/bin/mysqld (5.1.54) + {"5.1.54","9fca5d956c33e646920e68c541aabcae", 6344, 6408, 3696, 3968, 88, 2048}, + //offsets for: /mysql/5.1.55/bin/mysqld (5.1.55) + {"5.1.55","54457f3bc49d7ac7497f4212538c8ddc", 6344, 6408, 3696, 3968, 88, 2048}, + //offsets for: /mysql/5.1.56/bin/mysqld (5.1.56) + {"5.1.56","1a901cb4c1ff55aeab04ba4ba9e5f4ec", 6344, 6408, 3696, 3968, 88, 2048}, + //offsets for: /mysql/5.1.57/bin/mysqld (5.1.57) + {"5.1.57","c3c4f7c4403e501b11c532fb4eccf68b", 6344, 6408, 3696, 3968, 88, 2048}, + //offsets for: /mysql/5.1.58/bin/mysqld (5.1.58) + {"5.1.58","3e93f9d332fb8e3b9481f4620361f481", 6344, 6408, 3696, 3968, 88, 2048}, {"5.1.58","5620fefe93dbc46cb2d488a054d2e81a", 6344, 6408, 3696, 3968, 88, 2048}, //offsets for: /mysql/5.1.59/bin/mysqld (5.1.59) {"5.1.59","61fe56a6bcd71a9ea6026322f459555b", 6336, 6400, 3696, 3968, 88, 2048}, //offsets for: /mysql/5.1.60/bin/mysqld (5.1.60) {"5.1.60","5407e492f802cca03eccb2211205632d", 6336, 6400, 3696, 3968, 88, 2048}, - //offsets for: /mysql/5.1.61/bin/mysqld (5.1.61) + //offsets for: /mysql/5.1.61/bin/mysqld (5.1.61) {"5.1.61","c2ce56446b33ee22c16160b3f8206541", 6336, 6400, 3696, 3968, 88, 2048}, //offsets for: /mysql/5.1.62/bin/mysqld (5.1.62) {"5.1.62","5ab9ae376d93b71120e1c9dc2129c580", 6336, 6400, 3696, 3968, 88, 2048}, //offsets for: /mysql/5.1.63/bin/mysqld (5.1.63) {"5.1.63","ea56cc85859f146c42957177524492c3", 6336, 6400, 3696, 3968, 88, 2048}, //offsets set by https://github.com/creechy - {"5.1.63","2a6d7c81179baf6bc6bbb807b8b54967", 6336, 6400, 3696, 3968, 88, 2048}, - //offsets for: mysql/5.5.8/bin/mysqld (5.5.8) - {"5.5.8","a32b163f08ca8bfd7486cd77200d9df3", 6032, 6080, 3776, 4200, 88, 2560}, - //offsets for: mysql/5.5.9/bin/mysqld (5.5.9) - {"5.5.9","7b01c8b42a47f3541ee62b1e3f1b7816", 6056, 6104, 3800, 4224, 88, 2560}, - //offsets for: mysql/5.5.10/bin/mysqld (5.5.10) - {"5.5.10","de2bb7a3fa3cea8c3aae9e0c544ab8f4", 6056, 6104, 3800, 4224, 88, 2560}, - //offsets for: mysql/5.5.11/bin/mysqld (5.5.11) - {"5.5.11","cc565bd5de75d86ccf9371789afa3a15", 6048, 6096, 3792, 4216, 88, 2560}, - //offsets for: mysql/5.5.12/bin/mysqld (5.5.12) - {"5.5.12","a37a096e0c6afa81d023368434432a70", 6048, 6096, 3792, 4216, 88, 2560}, - //offsets for: mysql/5.5.13/bin/mysqld (5.5.13) - {"5.5.13","299abd40c9b5cf9421083aeddc8cfb66", 6048, 6096, 3792, 4216, 88, 2560}, - //offsets for: mysql/5.5.14/bin/mysqld (5.5.14) - {"5.5.14","98c716bb1ad38cf018d881dbf578fade", 6048, 6096, 3792, 4216, 88, 2560}, - //offsets for: mysql/5.5.15/bin/mysqld (5.5.15) - {"5.5.15","73a45e429c63542efbb70bcf56d869be", 6048, 6096, 3792, 4216, 88, 2560}, - {"5.5.15-debug","", 6256, 6304, 3992, 4424, 88, 2560}, - //offsets for: mysql/5.5.16/bin/mysqld (5.5.16) - {"5.5.16","9f4b0b7f721a0d57822c3e7417dec532", 6040, 6088, 3792, 4216, 88, 2560}, - //offsets for: mysql/5.5.17/bin/mysqld (5.5.17) - {"5.5.17","1998ce51314f86b587891dd80db067d6", 6040, 6088, 3792, 4216, 88, 2560}, - //offsets for: mysql/5.5.18/bin/mysqld (5.5.18) - {"5.5.18","d0a874863943e837a685e7fc4af02a87", 6040, 6088, 3792, 4216, 88, 2560}, - //offsets for: mysql/5.5.19/bin/mysqld (5.5.19) - //offsets for: /usr/sbin/mysqld (5.5.18) - {"5.5.18","099d31c0cd0754934b84c17f683d019e", 6040, 6088, 3792, 4216, 88, 2560}, - {"5.5.19","f000f941c4e4f7b84e66d7b8c115ca8f", 6048, 6096, 3800, 4224, 88, 2560}, - //offsets for: /mysql/5.5.20/bin/mysqld (5.5.20) - {"5.5.20","8b68e84332b442d58a46ae4299380a99", 6048, 6096, 3800, 4224, 88, 2560}, - //offsets for: mysql/5.5.21/bin/mysqld (5.5.21) + {"5.1.63","2a6d7c81179baf6bc6bbb807b8b54967", 6336, 6400, 3696, 3968, 88, 2048}, + //offsets for: mysql/5.5.8/bin/mysqld (5.5.8) + {"5.5.8","a32b163f08ca8bfd7486cd77200d9df3", 6032, 6080, 3776, 4200, 88, 2560}, + //offsets for: mysql/5.5.9/bin/mysqld (5.5.9) + {"5.5.9","7b01c8b42a47f3541ee62b1e3f1b7816", 6056, 6104, 3800, 4224, 88, 2560}, + //offsets for: mysql/5.5.10/bin/mysqld (5.5.10) + {"5.5.10","de2bb7a3fa3cea8c3aae9e0c544ab8f4", 6056, 6104, 3800, 4224, 88, 2560}, + //offsets for: mysql/5.5.11/bin/mysqld (5.5.11) + {"5.5.11","cc565bd5de75d86ccf9371789afa3a15", 6048, 6096, 3792, 4216, 88, 2560}, + //offsets for: mysql/5.5.12/bin/mysqld (5.5.12) + {"5.5.12","a37a096e0c6afa81d023368434432a70", 6048, 6096, 3792, 4216, 88, 2560}, + //offsets for: mysql/5.5.13/bin/mysqld (5.5.13) + {"5.5.13","299abd40c9b5cf9421083aeddc8cfb66", 6048, 6096, 3792, 4216, 88, 2560}, + //offsets for: mysql/5.5.14/bin/mysqld (5.5.14) + {"5.5.14","98c716bb1ad38cf018d881dbf578fade", 6048, 6096, 3792, 4216, 88, 2560}, + //offsets for: mysql/5.5.15/bin/mysqld (5.5.15) + {"5.5.15","73a45e429c63542efbb70bcf56d869be", 6048, 6096, 3792, 4216, 88, 2560}, + {"5.5.15-debug","", 6256, 6304, 3992, 4424, 88, 2560}, + //offsets for: mysql/5.5.16/bin/mysqld (5.5.16) + {"5.5.16","9f4b0b7f721a0d57822c3e7417dec532", 6040, 6088, 3792, 4216, 88, 2560}, + //offsets for: mysql/5.5.17/bin/mysqld (5.5.17) + {"5.5.17","1998ce51314f86b587891dd80db067d6", 6040, 6088, 3792, 4216, 88, 2560}, + //offsets for: mysql/5.5.18/bin/mysqld (5.5.18) + {"5.5.18","d0a874863943e837a685e7fc4af02a87", 6040, 6088, 3792, 4216, 88, 2560}, + //offsets for: mysql/5.5.19/bin/mysqld (5.5.19) + //offsets for: /usr/sbin/mysqld (5.5.18) + {"5.5.18","099d31c0cd0754934b84c17f683d019e", 6040, 6088, 3792, 4216, 88, 2560}, + {"5.5.19","f000f941c4e4f7b84e66d7b8c115ca8f", 6048, 6096, 3800, 4224, 88, 2560}, + //offsets for: /mysql/5.5.20/bin/mysqld (5.5.20) + {"5.5.20","8b68e84332b442d58a46ae4299380a99", 6048, 6096, 3800, 4224, 88, 2560}, + //offsets for: mysql/5.5.21/bin/mysqld (5.5.21) {"5.5.21","66d23cb577e2bcfe29da08833f5e7d8b", 6048, 6096, 3800, 4224, 88, 2560}, //offsets for: /mysql/5.5.22/bin/mysqld (5.5.22) {"5.5.22","9152de65a0de0594f46e1db0d0c9a182", 6048, 6096, 3800, 4224, 88, 2560}, @@ -267,104 +269,104 @@ static const ThdOffsets thd_offsets_arr[] = static const ThdOffsets thd_offsets_arr[] = { //DISTRIBUTION: rpm - //offsets for: mysqlrpm/5.1.30/usr/sbin/mysqld (5.1.30-community) - {"5.1.30-community","fdfe108d05c262c185a7c28b2e493c10", 4024, 4064, 2224, 2404, 44, 1180}, - //offsets for: mysqlrpm/5.1.31/usr/sbin/mysqld (5.1.31-community) - {"5.1.31-community","79e595a948564164886471fce7b90414", 4028, 4068, 2228, 2408, 44, 1172}, - //offsets for: mysqlrpm/5.1.32/usr/sbin/mysqld (5.1.32-community) - {"5.1.32-community","08bbc180f9aed54f3b8fb596360766cd", 4028, 4068, 2228, 2408, 44, 1172}, - //offsets for: mysqlrpm/5.1.33/usr/sbin/mysqld (5.1.33-community) - {"5.1.33-community","c9c3d4de320bbf721a13b0f2d7469a0d", 4032, 4072, 2228, 2408, 44, 1176}, - //offsets for: mysqlrpm/5.1.34/usr/sbin/mysqld (5.1.34-community) - {"5.1.34-community","806598500d6b9264dcd78eb6f0ed037b", 4036, 4076, 2232, 2412, 44, 1176}, - //offsets for: mysqlrpm/5.1.35/usr/sbin/mysqld (5.1.35-community) - {"5.1.35-community","b4202f285a39dc8875fb718e1310c2cd", 4036, 4076, 2232, 2412, 44, 1176}, - //offsets for: mysqlrpm/5.1.36/usr/sbin/mysqld (5.1.36-community) - {"5.1.36-community","76dd39a6a4bd61313745b984c186caa2", 4036, 4076, 2232, 2412, 44, 1176}, - //offsets for: mysqlrpm/5.1.37/usr/sbin/mysqld (5.1.37-community) - {"5.1.37-community","615173a7021b143a65c31d0e58d01172", 4036, 4076, 2232, 2412, 44, 1176}, - //offsets for: mysqlrpm/5.1.38/usr/sbin/mysqld (5.1.38-community) - {"5.1.38-community","f818189713bb56ccce507a4db4fcbfed", 4036, 4076, 2232, 2412, 44, 1176}, - //offsets for: mysqlrpm/5.1.39/usr/sbin/mysqld (5.1.39-community) - {"5.1.39-community","9951b3c9c050a9a5e0a2994295e0aa0c", 4036, 4076, 2232, 2412, 44, 1176}, - //offsets for: mysqlrpm/5.1.40/usr/sbin/mysqld (5.1.40-community) - {"5.1.40-community","3f44d47492e746e57883fb44e7f92195", 4036, 4076, 2232, 2412, 44, 1176}, - //offsets for: mysqlrpm/5.1.41/usr/sbin/mysqld (5.1.41-community) - {"5.1.41-community","b03f583f769bf2638170a157835baffb", 4036, 4076, 2232, 2412, 44, 1176}, - //offsets for: mysqlrpm/5.1.42/usr/sbin/mysqld (5.1.42-community) - {"5.1.42-community","ec01163698da7c64e9267e2e4b87133d", 4036, 4076, 2232, 2412, 44, 1176}, - //offsets for: mysqlrpm/5.1.43/usr/sbin/mysqld (5.1.43-community) - {"5.1.43-community","dc93f6b2f35e4b7c6814dc39e6bdf7f4", 4036, 4076, 2232, 2412, 44, 1176}, - //offsets for: mysqlrpm/5.1.44/usr/sbin/mysqld (5.1.44-community) - {"5.1.44-community","cd6f166239d377423533400bf7b00ea3", 4040, 4080, 2236, 2416, 44, 1176}, - //offsets for: mysqlrpm/5.1.45/usr/sbin/mysqld (5.1.45-community) - {"5.1.45-community","8dcfe0e4adfad351d33f0939442480f6", 4040, 4080, 2236, 2416, 44, 1176}, - //offsets for: mysqlrpm/5.1.46/usr/sbin/mysqld (5.1.46-community) - {"5.1.46-community","5e2689bea4fbccceed1e32cd96cc3c34", 4040, 4080, 2236, 2416, 44, 1176}, - //offsets for: mysqlrpm/5.1.47/usr/sbin/mysqld (5.1.47-community) - {"5.1.47-community","d24830298658630ff57c28e886f7867a", 4104, 4144, 2240, 2420, 44, 1176}, - //offsets for: mysqlrpm/5.1.48/usr/sbin/mysqld (5.1.48-community) - {"5.1.48-community","0fb5da11cb2af69c9c8ccb4e7e09c2ba", 4104, 4144, 2240, 2420, 44, 1176}, - //offsets for: mysqlrpm/5.1.49/usr/sbin/mysqld (5.1.49-community) - {"5.1.49-community","44c5f411e0ca0251afed127c2eab099a", 4104, 4144, 2240, 2420, 44, 1176}, - //offsets for: mysqlrpm/5.1.50/usr/sbin/mysqld (5.1.50-community) - {"5.1.50-community","ba318e3ea6c628e771c061bc8f8fd747", 4104, 4144, 2240, 2420, 44, 1176}, - //offsets for: mysqlrpm/5.1.51/usr/sbin/mysqld (5.1.51-community) - {"5.1.51-community","9e3294ed95b2f1197466f3b4100074b4", 4104, 4144, 2240, 2420, 44, 1176}, - //offsets for: mysqlrpm/5.1.52/usr/sbin/mysqld (5.1.52-community) - {"5.1.52-community","6bef5cbe540f8a5d445b9ae243a0d228", 4104, 4144, 2240, 2420, 44, 1176}, - //offsets for: mysqlrpm/5.1.53/usr/sbin/mysqld (5.1.53-community) - {"5.1.53-community","cd34abf1b7cc20928a30b23c9270bae9", 4104, 4144, 2240, 2420, 44, 1176}, - //offsets for: mysqlrpm/5.1.54/usr/sbin/mysqld (5.1.54-community) - {"5.1.54-community","af4e3ed1f31aba894714bb9dd572b920", 4104, 4144, 2240, 2420, 44, 1176}, - //offsets for: mysqlrpm/5.1.55/usr/sbin/mysqld (5.1.55-community) - {"5.1.55-community","3b201091f1f87ec89c0f69b5e5712cd5", 4104, 4144, 2240, 2420, 44, 1176}, - //offsets for: mysqlrpm/5.1.56/usr/sbin/mysqld (5.1.56-community) - {"5.1.56-community","43fb22017f5fb7ba436dbf53fe45ac5d", 4104, 4144, 2240, 2420, 44, 1176}, - //offsets for: mysqlrpm/5.1.57/usr/sbin/mysqld (5.1.57-community) - {"5.1.57-community","b3b137aaa9550b070185e7fb1b788a97", 4104, 4144, 2240, 2420, 44, 1176}, - //offsets for: mysqlrpm/5.1.58/usr/sbin/mysqld (5.1.58-community) - {"5.1.58-community","728f80ea4a231f85b2dc8661bf6828fc", 4104, 4144, 2240, 2420, 44, 1176}, - {"5.1.58-community","a4199c1595d0ef3f0b1a2ffbc4e74976", 4104, 4144, 2240, 2420, 44, 1176}, - {"5.1.58-community","5d9be93190a88860d0d4f4033c2d3d09", 4104, 4144, 2240, 2420, 44, 1176}, + //offsets for: mysqlrpm/5.1.30/usr/sbin/mysqld (5.1.30-community) + {"5.1.30-community","fdfe108d05c262c185a7c28b2e493c10", 4024, 4064, 2224, 2404, 44, 1180}, + //offsets for: mysqlrpm/5.1.31/usr/sbin/mysqld (5.1.31-community) + {"5.1.31-community","79e595a948564164886471fce7b90414", 4028, 4068, 2228, 2408, 44, 1172}, + //offsets for: mysqlrpm/5.1.32/usr/sbin/mysqld (5.1.32-community) + {"5.1.32-community","08bbc180f9aed54f3b8fb596360766cd", 4028, 4068, 2228, 2408, 44, 1172}, + //offsets for: mysqlrpm/5.1.33/usr/sbin/mysqld (5.1.33-community) + {"5.1.33-community","c9c3d4de320bbf721a13b0f2d7469a0d", 4032, 4072, 2228, 2408, 44, 1176}, + //offsets for: mysqlrpm/5.1.34/usr/sbin/mysqld (5.1.34-community) + {"5.1.34-community","806598500d6b9264dcd78eb6f0ed037b", 4036, 4076, 2232, 2412, 44, 1176}, + //offsets for: mysqlrpm/5.1.35/usr/sbin/mysqld (5.1.35-community) + {"5.1.35-community","b4202f285a39dc8875fb718e1310c2cd", 4036, 4076, 2232, 2412, 44, 1176}, + //offsets for: mysqlrpm/5.1.36/usr/sbin/mysqld (5.1.36-community) + {"5.1.36-community","76dd39a6a4bd61313745b984c186caa2", 4036, 4076, 2232, 2412, 44, 1176}, + //offsets for: mysqlrpm/5.1.37/usr/sbin/mysqld (5.1.37-community) + {"5.1.37-community","615173a7021b143a65c31d0e58d01172", 4036, 4076, 2232, 2412, 44, 1176}, + //offsets for: mysqlrpm/5.1.38/usr/sbin/mysqld (5.1.38-community) + {"5.1.38-community","f818189713bb56ccce507a4db4fcbfed", 4036, 4076, 2232, 2412, 44, 1176}, + //offsets for: mysqlrpm/5.1.39/usr/sbin/mysqld (5.1.39-community) + {"5.1.39-community","9951b3c9c050a9a5e0a2994295e0aa0c", 4036, 4076, 2232, 2412, 44, 1176}, + //offsets for: mysqlrpm/5.1.40/usr/sbin/mysqld (5.1.40-community) + {"5.1.40-community","3f44d47492e746e57883fb44e7f92195", 4036, 4076, 2232, 2412, 44, 1176}, + //offsets for: mysqlrpm/5.1.41/usr/sbin/mysqld (5.1.41-community) + {"5.1.41-community","b03f583f769bf2638170a157835baffb", 4036, 4076, 2232, 2412, 44, 1176}, + //offsets for: mysqlrpm/5.1.42/usr/sbin/mysqld (5.1.42-community) + {"5.1.42-community","ec01163698da7c64e9267e2e4b87133d", 4036, 4076, 2232, 2412, 44, 1176}, + //offsets for: mysqlrpm/5.1.43/usr/sbin/mysqld (5.1.43-community) + {"5.1.43-community","dc93f6b2f35e4b7c6814dc39e6bdf7f4", 4036, 4076, 2232, 2412, 44, 1176}, + //offsets for: mysqlrpm/5.1.44/usr/sbin/mysqld (5.1.44-community) + {"5.1.44-community","cd6f166239d377423533400bf7b00ea3", 4040, 4080, 2236, 2416, 44, 1176}, + //offsets for: mysqlrpm/5.1.45/usr/sbin/mysqld (5.1.45-community) + {"5.1.45-community","8dcfe0e4adfad351d33f0939442480f6", 4040, 4080, 2236, 2416, 44, 1176}, + //offsets for: mysqlrpm/5.1.46/usr/sbin/mysqld (5.1.46-community) + {"5.1.46-community","5e2689bea4fbccceed1e32cd96cc3c34", 4040, 4080, 2236, 2416, 44, 1176}, + //offsets for: mysqlrpm/5.1.47/usr/sbin/mysqld (5.1.47-community) + {"5.1.47-community","d24830298658630ff57c28e886f7867a", 4104, 4144, 2240, 2420, 44, 1176}, + //offsets for: mysqlrpm/5.1.48/usr/sbin/mysqld (5.1.48-community) + {"5.1.48-community","0fb5da11cb2af69c9c8ccb4e7e09c2ba", 4104, 4144, 2240, 2420, 44, 1176}, + //offsets for: mysqlrpm/5.1.49/usr/sbin/mysqld (5.1.49-community) + {"5.1.49-community","44c5f411e0ca0251afed127c2eab099a", 4104, 4144, 2240, 2420, 44, 1176}, + //offsets for: mysqlrpm/5.1.50/usr/sbin/mysqld (5.1.50-community) + {"5.1.50-community","ba318e3ea6c628e771c061bc8f8fd747", 4104, 4144, 2240, 2420, 44, 1176}, + //offsets for: mysqlrpm/5.1.51/usr/sbin/mysqld (5.1.51-community) + {"5.1.51-community","9e3294ed95b2f1197466f3b4100074b4", 4104, 4144, 2240, 2420, 44, 1176}, + //offsets for: mysqlrpm/5.1.52/usr/sbin/mysqld (5.1.52-community) + {"5.1.52-community","6bef5cbe540f8a5d445b9ae243a0d228", 4104, 4144, 2240, 2420, 44, 1176}, + //offsets for: mysqlrpm/5.1.53/usr/sbin/mysqld (5.1.53-community) + {"5.1.53-community","cd34abf1b7cc20928a30b23c9270bae9", 4104, 4144, 2240, 2420, 44, 1176}, + //offsets for: mysqlrpm/5.1.54/usr/sbin/mysqld (5.1.54-community) + {"5.1.54-community","af4e3ed1f31aba894714bb9dd572b920", 4104, 4144, 2240, 2420, 44, 1176}, + //offsets for: mysqlrpm/5.1.55/usr/sbin/mysqld (5.1.55-community) + {"5.1.55-community","3b201091f1f87ec89c0f69b5e5712cd5", 4104, 4144, 2240, 2420, 44, 1176}, + //offsets for: mysqlrpm/5.1.56/usr/sbin/mysqld (5.1.56-community) + {"5.1.56-community","43fb22017f5fb7ba436dbf53fe45ac5d", 4104, 4144, 2240, 2420, 44, 1176}, + //offsets for: mysqlrpm/5.1.57/usr/sbin/mysqld (5.1.57-community) + {"5.1.57-community","b3b137aaa9550b070185e7fb1b788a97", 4104, 4144, 2240, 2420, 44, 1176}, + //offsets for: mysqlrpm/5.1.58/usr/sbin/mysqld (5.1.58-community) + {"5.1.58-community","728f80ea4a231f85b2dc8661bf6828fc", 4104, 4144, 2240, 2420, 44, 1176}, + {"5.1.58-community","a4199c1595d0ef3f0b1a2ffbc4e74976", 4104, 4144, 2240, 2420, 44, 1176}, + {"5.1.58-community","5d9be93190a88860d0d4f4033c2d3d09", 4104, 4144, 2240, 2420, 44, 1176}, {"5.1.58-community","5b7a9bca308184339999f42db6224467", 4104, 4144, 2240, 2420, 44, 1176}, //offsets for: /mysqlrpm/5.1.59/usr/sbin/mysqld (5.1.59-community) {"5.1.59-community","2405f0bf32c0a1439a157e54431443de", 4096, 4136, 2240, 2420, 44, 1176}, //offsets for: /mysqlrpm/5.1.60/usr/sbin/mysqld (5.1.60-community) - {"5.1.60-community","bc2d74ea58d22d998f8f8c88139fc5f7", 4096, 4136, 2240, 2420, 44, 1176}, - //offsets for: /mysqlrpm/5.1.61/usr/sbin/mysqld (5.1.61-community) + {"5.1.60-community","bc2d74ea58d22d998f8f8c88139fc5f7", 4096, 4136, 2240, 2420, 44, 1176}, + //offsets for: /mysqlrpm/5.1.61/usr/sbin/mysqld (5.1.61-community) {"5.1.61-community","f73013eb2001a02c84ddd0ac42a307ac", 4096, 4136, 2240, 2420, 44, 1176}, //offsets for: /mysqlrpm/5.1.62/usr/sbin/mysqld (5.1.62-community) {"5.1.62-community","f410638e7414c6cc709b7d5cda24669c", 4096, 4136, 2240, 2420, 44, 1176}, //offsets for: /mysqlrpm/5.1.63/usr/sbin/mysqld (5.1.63-community) - {"5.1.63-community","2b39264a67466c6f1dfa37c37a8a6bd0", 4096, 4136, 2240, 2420, 44, 1176}, - //offsets for: mysqlrpm/5.5.8/usr/sbin/mysqld (5.5.8) - {"5.5.8","3132e8c883f72caf4c8eddb24fd005b4", 3792, 3820, 2336, 2668, 44, 1640}, - //offsets for: mysqlrpm/5.5.9/usr/sbin/mysqld (5.5.9) - {"5.5.9","1f9f8f5109687db75c15bc04d4396842", 3816, 3844, 2360, 2692, 44, 1640}, - //offsets for: mysqlrpm/5.5.10/usr/sbin/mysqld (5.5.10) - {"5.5.10","f9e6ef8075fe370842c0fce571eac6e1", 3816, 3844, 2360, 2692, 44, 1640}, - //offsets for: mysqlrpm/5.5.11/usr/sbin/mysqld (5.5.11) - {"5.5.11","37c160fac1cc844fc4aa09bb23a60022", 3812, 3840, 2356, 2688, 44, 1640}, - //offsets for: mysqlrpm/5.5.12/usr/sbin/mysqld (5.5.12) - {"5.5.12","565093ea45815edd8fa8bd444825aa6d", 3812, 3840, 2356, 2688, 44, 1640}, - //offsets for: mysqlrpm/5.5.13/usr/sbin/mysqld (5.5.13) - {"5.5.13","0592c10129e360623a70bbcc1618c7ad", 3812, 3840, 2356, 2688, 44, 1640}, - //offsets for: mysqlrpm/5.5.14/usr/sbin/mysqld (5.5.14) - {"5.5.14","53eca2f96ec9185c1b733c2b254fa416", 3812, 3840, 2356, 2688, 44, 1640}, - //offsets for: mysqlrpm/5.5.15/usr/sbin/mysqld (5.5.15) - {"5.5.15","01fa6e9c9eafb638c801cc3d261dca70", 3812, 3840, 2356, 2688, 44, 1640}, - //offsets for: mysqlrpm/5.5.16/usr/sbin/mysqld (5.5.16) - {"5.5.16","0959bb8b5a0fa940c900873ff743bd59", 3804, 3832, 2356, 2688, 44, 1640}, - //offsets for: mysqlrpm/5.5.17/usr/sbin/mysqld (5.5.17) - {"5.5.17","c99b809e13c52ac0e173baff0df24f75", 3804, 3832, 2356, 2688, 44, 1640}, - //offsets for: mysqlrpm/5.5.18/usr/sbin/mysqld (5.5.18) - {"5.5.18","bbeb7e7ad983ea1db87665d8e530f6b6", 3804, 3832, 2356, 2688, 44, 1640}, - //offsets for: mysqlrpm/5.5.19/usr/sbin/mysqld (5.5.19) - {"5.5.19","f3c31e2a5d95d3511b7106441f38929e", 3808, 3836, 2360, 2692, 44, 1640}, - //offsets for: /mysqlrpm/5.5.20/usr/sbin/mysqld (5.5.20) - {"5.5.20","c73100bcb0d967b627cad72e66503194", 3808, 3836, 2360, 2692, 44, 1640}, - //offsets for: mysqlrpm/5.5.21/usr/sbin/mysqld (5.5.21) + {"5.1.63-community","2b39264a67466c6f1dfa37c37a8a6bd0", 4096, 4136, 2240, 2420, 44, 1176}, + //offsets for: mysqlrpm/5.5.8/usr/sbin/mysqld (5.5.8) + {"5.5.8","3132e8c883f72caf4c8eddb24fd005b4", 3792, 3820, 2336, 2668, 44, 1640}, + //offsets for: mysqlrpm/5.5.9/usr/sbin/mysqld (5.5.9) + {"5.5.9","1f9f8f5109687db75c15bc04d4396842", 3816, 3844, 2360, 2692, 44, 1640}, + //offsets for: mysqlrpm/5.5.10/usr/sbin/mysqld (5.5.10) + {"5.5.10","f9e6ef8075fe370842c0fce571eac6e1", 3816, 3844, 2360, 2692, 44, 1640}, + //offsets for: mysqlrpm/5.5.11/usr/sbin/mysqld (5.5.11) + {"5.5.11","37c160fac1cc844fc4aa09bb23a60022", 3812, 3840, 2356, 2688, 44, 1640}, + //offsets for: mysqlrpm/5.5.12/usr/sbin/mysqld (5.5.12) + {"5.5.12","565093ea45815edd8fa8bd444825aa6d", 3812, 3840, 2356, 2688, 44, 1640}, + //offsets for: mysqlrpm/5.5.13/usr/sbin/mysqld (5.5.13) + {"5.5.13","0592c10129e360623a70bbcc1618c7ad", 3812, 3840, 2356, 2688, 44, 1640}, + //offsets for: mysqlrpm/5.5.14/usr/sbin/mysqld (5.5.14) + {"5.5.14","53eca2f96ec9185c1b733c2b254fa416", 3812, 3840, 2356, 2688, 44, 1640}, + //offsets for: mysqlrpm/5.5.15/usr/sbin/mysqld (5.5.15) + {"5.5.15","01fa6e9c9eafb638c801cc3d261dca70", 3812, 3840, 2356, 2688, 44, 1640}, + //offsets for: mysqlrpm/5.5.16/usr/sbin/mysqld (5.5.16) + {"5.5.16","0959bb8b5a0fa940c900873ff743bd59", 3804, 3832, 2356, 2688, 44, 1640}, + //offsets for: mysqlrpm/5.5.17/usr/sbin/mysqld (5.5.17) + {"5.5.17","c99b809e13c52ac0e173baff0df24f75", 3804, 3832, 2356, 2688, 44, 1640}, + //offsets for: mysqlrpm/5.5.18/usr/sbin/mysqld (5.5.18) + {"5.5.18","bbeb7e7ad983ea1db87665d8e530f6b6", 3804, 3832, 2356, 2688, 44, 1640}, + //offsets for: mysqlrpm/5.5.19/usr/sbin/mysqld (5.5.19) + {"5.5.19","f3c31e2a5d95d3511b7106441f38929e", 3808, 3836, 2360, 2692, 44, 1640}, + //offsets for: /mysqlrpm/5.5.20/usr/sbin/mysqld (5.5.20) + {"5.5.20","c73100bcb0d967b627cad72e66503194", 3808, 3836, 2360, 2692, 44, 1640}, + //offsets for: mysqlrpm/5.5.21/usr/sbin/mysqld (5.5.21) {"5.5.21","18d78ced97227b83e62e9b43ba5b3883", 3808, 3836, 2360, 2692, 44, 1640}, //offsets for: /mysqlrpm/5.5.22/usr/sbin/mysqld (5.5.22) {"5.5.22","9da3081f83069a2762831d0ead5a97c8", 3808, 3836, 2360, 2692, 44, 1640}, @@ -373,108 +375,108 @@ static const ThdOffsets thd_offsets_arr[] = //offsets for: /mysqlrpm/5.5.24/usr/sbin/mysqld (5.5.24) {"5.5.24","10e0ced8d28daf6a9c16d2b57be7c6af", 3808, 3836, 2360, 2692, 44, 1644}, //offsets for: /mysqlrpm/5.5.25/usr/sbin/mysqld (5.5.25) - {"5.5.25","bd20af37978967a145724098e913eeda", 3812, 3840, 2364, 2696, 44, 1644}, + {"5.5.25","bd20af37978967a145724098e913eeda", 3812, 3840, 2364, 2696, 44, 1644}, //DISTRIBUTION: tar.gz - //offsets for: mysql/5.1.30/bin/mysqld (5.1.30) - {"5.1.30","f02d15a37e8e7513e7570023b48ccb4d", 4028, 4068, 2228, 2408, 44, 1180}, - //offsets for: mysql/5.1.31/bin/mysqld (5.1.31) - {"5.1.31","a3a240c57429f67c4fcb5c960d30f5cc", 4036, 4076, 2236, 2416, 44, 1172}, - //offsets for: mysql/5.1.32/bin/mysqld (5.1.32) - {"5.1.32","b8d4491363c8b4e4fb61fce807cb849c", 4036, 4076, 2236, 2416, 44, 1172}, - //offsets for: mysql/5.1.33/bin/mysqld (5.1.33) - {"5.1.33","1b8c93710fe908565cf434b8a4a472c6", 4040, 4080, 2236, 2416, 44, 1176}, - //offsets for: mysql/5.1.34/bin/mysqld (5.1.34) - {"5.1.34","dcbd60d1c75bcb75b75bf0428b64bcfa", 4044, 4084, 2240, 2420, 44, 1176}, - //offsets for: mysql/5.1.35/bin/mysqld (5.1.35) - {"5.1.35","ffd1fa84e00daace393e5450298fcbeb", 4044, 4084, 2240, 2420, 44, 1176}, - //offsets for: mysql/5.1.36/bin/mysqld (5.1.36) - {"5.1.36","3a45ab0b7d8bcac42933b8635b7898ef", 4044, 4084, 2240, 2420, 44, 1176}, - //offsets for: mysql/5.1.37/bin/mysqld (5.1.37) - {"5.1.37","fb51c158439a1a2524048822f803b900", 4044, 4084, 2240, 2420, 44, 1176}, - //offsets for: mysql/5.1.38/bin/mysqld (5.1.38) - {"5.1.38","3325969a0feffd660968ff489d59e648", 4044, 4084, 2240, 2420, 44, 1176}, - //offsets for: mysql/5.1.39/bin/mysqld (5.1.39) - {"5.1.39","e3c3f1ab7d6f11d4db161f76e01ae229", 4044, 4084, 2240, 2420, 44, 1176}, - //offsets for: mysql/5.1.40/bin/mysqld (5.1.40) - {"5.1.40","f068b9eef84e76556e90889148011911", 4044, 4084, 2240, 2420, 44, 1176}, - //offsets for: mysql/5.1.41/bin/mysqld (5.1.41) - {"5.1.41","dcfa2d28d2bb193d8883bf0f465582db", 4044, 4084, 2240, 2420, 44, 1176}, - //offsets for: mysql/5.1.42/bin/mysqld (5.1.42) - {"5.1.42","f384b97929c2cef7cfe292cc2d1ed018", 4044, 4084, 2240, 2420, 44, 1176}, - //offsets for: mysql/5.1.43/bin/mysqld (5.1.43) - {"5.1.43","10035c4e3877da190d6f2b00c3f28eea", 4044, 4084, 2240, 2420, 44, 1176}, - //offsets for: mysql/5.1.44/bin/mysqld (5.1.44) - {"5.1.44","5119573ff0a4ad1688a5ac6412b5b51a", 4048, 4088, 2244, 2424, 44, 1176}, - //offsets for: mysql/5.1.45/bin/mysqld (5.1.45) - {"5.1.45","8a57e78f7b0bf6818ba032c05a4b5c6b", 4048, 4088, 2244, 2424, 44, 1176}, - //offsets for: mysql/5.1.46/bin/mysqld (5.1.46) - {"5.1.46","090c3c45fbe7a37fa83b1567604d9598", 4048, 4088, 2244, 2424, 44, 1176}, - //offsets for: mysql/5.1.47/bin/mysqld (5.1.47) - {"5.1.47","1864a85030c04e85dc9c9c37db449e11", 4112, 4152, 2248, 2428, 44, 1176}, - //offsets for: mysql/5.1.48/bin/mysqld (5.1.48) - {"5.1.48","73a8915a1549012fcfeefe285f9dda3b", 4112, 4152, 2248, 2428, 44, 1176}, - //offsets for: mysql/5.1.49/bin/mysqld (5.1.49) - {"5.1.49","cc318106e6d7670c2e0d787c61c64e3e", 4112, 4152, 2248, 2428, 44, 1176}, - //offsets for: mysql/5.1.50/bin/mysqld (5.1.50) - {"5.1.50","d651dd6ba898bb6fe4b94a820f6bc670", 4112, 4152, 2248, 2428, 44, 1176}, - //offsets for: mysql/5.1.51/bin/mysqld (5.1.51) - {"5.1.51","bc5b02298ab8f928c57055a1ddf9f9eb", 4112, 4152, 2248, 2428, 44, 1176}, - //offsets for: mysql/5.1.52/bin/mysqld (5.1.52) - {"5.1.52","1553d70d4a1e50cbc3372cfc19c781d1", 4112, 4152, 2248, 2428, 44, 1176}, - //offsets for: mysql/5.1.53/bin/mysqld (5.1.53) - {"5.1.53","c9e447344659169b6a94c24b30872539", 4112, 4152, 2248, 2428, 44, 1176}, - //offsets for: mysql/5.1.54/bin/mysqld (5.1.54) - {"5.1.54","bf71b8a6a3ba8d1dccae9173d1b24f1c", 4112, 4152, 2248, 2428, 44, 1176}, - //offsets for: mysql/5.1.55/bin/mysqld (5.1.55) - {"5.1.55","9fad028c88f5236d6d573b49d228cfbd", 4112, 4152, 2248, 2428, 44, 1176}, - //offsets for: mysql/5.1.56/bin/mysqld (5.1.56) - {"5.1.56","01ed5d208a836a81770a9b4cf7e3c950", 4112, 4152, 2248, 2428, 44, 1176}, - //offsets for: mysql/5.1.57/bin/mysqld (5.1.57) - {"5.1.57","e180e87ea25ddf3834a6f397e56e6df6", 4112, 4152, 2248, 2428, 44, 1176}, - //offsets for: mysql/5.1.58/bin/mysqld (5.1.58) + //offsets for: mysql/5.1.30/bin/mysqld (5.1.30) + {"5.1.30","f02d15a37e8e7513e7570023b48ccb4d", 4028, 4068, 2228, 2408, 44, 1180}, + //offsets for: mysql/5.1.31/bin/mysqld (5.1.31) + {"5.1.31","a3a240c57429f67c4fcb5c960d30f5cc", 4036, 4076, 2236, 2416, 44, 1172}, + //offsets for: mysql/5.1.32/bin/mysqld (5.1.32) + {"5.1.32","b8d4491363c8b4e4fb61fce807cb849c", 4036, 4076, 2236, 2416, 44, 1172}, + //offsets for: mysql/5.1.33/bin/mysqld (5.1.33) + {"5.1.33","1b8c93710fe908565cf434b8a4a472c6", 4040, 4080, 2236, 2416, 44, 1176}, + //offsets for: mysql/5.1.34/bin/mysqld (5.1.34) + {"5.1.34","dcbd60d1c75bcb75b75bf0428b64bcfa", 4044, 4084, 2240, 2420, 44, 1176}, + //offsets for: mysql/5.1.35/bin/mysqld (5.1.35) + {"5.1.35","ffd1fa84e00daace393e5450298fcbeb", 4044, 4084, 2240, 2420, 44, 1176}, + //offsets for: mysql/5.1.36/bin/mysqld (5.1.36) + {"5.1.36","3a45ab0b7d8bcac42933b8635b7898ef", 4044, 4084, 2240, 2420, 44, 1176}, + //offsets for: mysql/5.1.37/bin/mysqld (5.1.37) + {"5.1.37","fb51c158439a1a2524048822f803b900", 4044, 4084, 2240, 2420, 44, 1176}, + //offsets for: mysql/5.1.38/bin/mysqld (5.1.38) + {"5.1.38","3325969a0feffd660968ff489d59e648", 4044, 4084, 2240, 2420, 44, 1176}, + //offsets for: mysql/5.1.39/bin/mysqld (5.1.39) + {"5.1.39","e3c3f1ab7d6f11d4db161f76e01ae229", 4044, 4084, 2240, 2420, 44, 1176}, + //offsets for: mysql/5.1.40/bin/mysqld (5.1.40) + {"5.1.40","f068b9eef84e76556e90889148011911", 4044, 4084, 2240, 2420, 44, 1176}, + //offsets for: mysql/5.1.41/bin/mysqld (5.1.41) + {"5.1.41","dcfa2d28d2bb193d8883bf0f465582db", 4044, 4084, 2240, 2420, 44, 1176}, + //offsets for: mysql/5.1.42/bin/mysqld (5.1.42) + {"5.1.42","f384b97929c2cef7cfe292cc2d1ed018", 4044, 4084, 2240, 2420, 44, 1176}, + //offsets for: mysql/5.1.43/bin/mysqld (5.1.43) + {"5.1.43","10035c4e3877da190d6f2b00c3f28eea", 4044, 4084, 2240, 2420, 44, 1176}, + //offsets for: mysql/5.1.44/bin/mysqld (5.1.44) + {"5.1.44","5119573ff0a4ad1688a5ac6412b5b51a", 4048, 4088, 2244, 2424, 44, 1176}, + //offsets for: mysql/5.1.45/bin/mysqld (5.1.45) + {"5.1.45","8a57e78f7b0bf6818ba032c05a4b5c6b", 4048, 4088, 2244, 2424, 44, 1176}, + //offsets for: mysql/5.1.46/bin/mysqld (5.1.46) + {"5.1.46","090c3c45fbe7a37fa83b1567604d9598", 4048, 4088, 2244, 2424, 44, 1176}, + //offsets for: mysql/5.1.47/bin/mysqld (5.1.47) + {"5.1.47","1864a85030c04e85dc9c9c37db449e11", 4112, 4152, 2248, 2428, 44, 1176}, + //offsets for: mysql/5.1.48/bin/mysqld (5.1.48) + {"5.1.48","73a8915a1549012fcfeefe285f9dda3b", 4112, 4152, 2248, 2428, 44, 1176}, + //offsets for: mysql/5.1.49/bin/mysqld (5.1.49) + {"5.1.49","cc318106e6d7670c2e0d787c61c64e3e", 4112, 4152, 2248, 2428, 44, 1176}, + //offsets for: mysql/5.1.50/bin/mysqld (5.1.50) + {"5.1.50","d651dd6ba898bb6fe4b94a820f6bc670", 4112, 4152, 2248, 2428, 44, 1176}, + //offsets for: mysql/5.1.51/bin/mysqld (5.1.51) + {"5.1.51","bc5b02298ab8f928c57055a1ddf9f9eb", 4112, 4152, 2248, 2428, 44, 1176}, + //offsets for: mysql/5.1.52/bin/mysqld (5.1.52) + {"5.1.52","1553d70d4a1e50cbc3372cfc19c781d1", 4112, 4152, 2248, 2428, 44, 1176}, + //offsets for: mysql/5.1.53/bin/mysqld (5.1.53) + {"5.1.53","c9e447344659169b6a94c24b30872539", 4112, 4152, 2248, 2428, 44, 1176}, + //offsets for: mysql/5.1.54/bin/mysqld (5.1.54) + {"5.1.54","bf71b8a6a3ba8d1dccae9173d1b24f1c", 4112, 4152, 2248, 2428, 44, 1176}, + //offsets for: mysql/5.1.55/bin/mysqld (5.1.55) + {"5.1.55","9fad028c88f5236d6d573b49d228cfbd", 4112, 4152, 2248, 2428, 44, 1176}, + //offsets for: mysql/5.1.56/bin/mysqld (5.1.56) + {"5.1.56","01ed5d208a836a81770a9b4cf7e3c950", 4112, 4152, 2248, 2428, 44, 1176}, + //offsets for: mysql/5.1.57/bin/mysqld (5.1.57) + {"5.1.57","e180e87ea25ddf3834a6f397e56e6df6", 4112, 4152, 2248, 2428, 44, 1176}, + //offsets for: mysql/5.1.58/bin/mysqld (5.1.58) {"5.1.58","46795902e2a8a54976e3c4fd81cb567f", 4112, 4152, 2248, 2428, 44, 1176}, {"5.1.58","3200476a63ce76810171d6791fdfb1fe", 4112, 4152, 2248, 2428, 44, 1176}, //offsets for: /mysql/5.1.59/bin/mysqld (5.1.59) {"5.1.59","3122bfbeea3e4b420be996eb64244fb4", 4104, 4144, 2248, 2428, 44, 1176}, //offsets for: /mysql/5.1.60/bin/mysqld (5.1.60) {"5.1.60","520270041d8c490d49233e88741c025c", 4104, 4144, 2248, 2428, 44, 1176}, - //offsets for: /mysql/5.1.61/bin/mysqld (5.1.61) + //offsets for: /mysql/5.1.61/bin/mysqld (5.1.61) {"5.1.61","1a7a0981d77f4d212e899efaa581bd42", 4104, 4144, 2248, 2428, 44, 1176}, //offsets for: /mysql/5.1.62/bin/mysqld (5.1.62) {"5.1.62","4c5fd81faa9fe407c8a7fbd11b29351a", 4104, 4144, 2248, 2428, 44, 1176}, //offsets for: /mysql/5.1.63/bin/mysqld (5.1.63) - {"5.1.63","576124febe6310985e432f6346031ff4", 4104, 4144, 2248, 2428, 44, 1176}, - //offsets for: /mysqlrpm/5.5.8/usr/sbin/mysqld (5.5.8) + {"5.1.63","576124febe6310985e432f6346031ff4", 4104, 4144, 2248, 2428, 44, 1176}, + //offsets for: /mysqlrpm/5.5.8/usr/sbin/mysqld (5.5.8) {"5.5.8","3132e8c883f72caf4c8eddb24fd005b4", 3792, 3820, 2336, 2668, 44, 1640}, {"5.5.8","ad8a16d9bbfb783dab53f38cef757900", 3792, 3820, 2336, 2668, 44, 1640}, - //offsets for: /mysql/5.5.8/bin/mysqld (5.5.8) - {"5.5.8","9fad75a10170625712be354ec5b52f2d", 3792, 3820, 2336, 2668, 44, 1640}, - //offsets for: /mysql/5.5.9/bin/mysqld (5.5.9) - {"5.5.9","6ff8ac441ea0e5ff90dc95a47443ea8c", 3816, 3844, 2360, 2692, 44, 1640}, - //offsets for: /mysql/5.5.10/bin/mysqld (5.5.10) - {"5.5.10","f27715ede95269b83527338739184f49", 3816, 3844, 2360, 2692, 44, 1640}, - //offsets for: /mysql/5.5.11/bin/mysqld (5.5.11) - {"5.5.11","896bf69c3b42fb77e9efdd5fd3661800", 3812, 3840, 2356, 2688, 44, 1640}, - //offsets for: /mysql/5.5.12/bin/mysqld (5.5.12) - {"5.5.12","c95e1181fadd0a04fe2c7a153058b6f3", 3812, 3840, 2356, 2688, 44, 1640}, - //offsets for: /mysql/5.5.13/bin/mysqld (5.5.13) - {"5.5.13","d22b9d5bccd9f8bdb3158a87edd0992e", 3812, 3840, 2356, 2688, 44, 1640}, - //offsets for: /mysql/5.5.14/bin/mysqld (5.5.14) - {"5.5.14","e77fa342d52bd3a7cbd551b8a9649e40", 3812, 3840, 2356, 2688, 44, 1640}, - //offsets for: /mysql/5.5.15/bin/mysqld (5.5.15) - {"5.5.15","f070920da92c8fdf920f516bfbf7cbb4", 3812, 3840, 2356, 2688, 44, 1640}, - //offsets for: /mysql/5.5.16/bin/mysqld (5.5.16) - {"5.5.16","291c0f871da9691a2271d48e79d7cf2b", 3804, 3832, 2356, 2688, 44, 1640}, - //offsets for: /mysql/5.5.17/bin/mysqld (5.5.17) - {"5.5.17","64fde4494dbdd3e05457df5ac93c7760", 3804, 3832, 2356, 2688, 44, 1640}, - //offsets for: /mysql/5.5.18/bin/mysqld (5.5.18) - {"5.5.18","5f6f2516ff4728f3b04613ed66233aa5", 3804, 3832, 2356, 2688, 44, 1640}, - //offsets for: /mysql/5.5.19/bin/mysqld (5.5.19) + //offsets for: /mysql/5.5.8/bin/mysqld (5.5.8) + {"5.5.8","9fad75a10170625712be354ec5b52f2d", 3792, 3820, 2336, 2668, 44, 1640}, + //offsets for: /mysql/5.5.9/bin/mysqld (5.5.9) + {"5.5.9","6ff8ac441ea0e5ff90dc95a47443ea8c", 3816, 3844, 2360, 2692, 44, 1640}, + //offsets for: /mysql/5.5.10/bin/mysqld (5.5.10) + {"5.5.10","f27715ede95269b83527338739184f49", 3816, 3844, 2360, 2692, 44, 1640}, + //offsets for: /mysql/5.5.11/bin/mysqld (5.5.11) + {"5.5.11","896bf69c3b42fb77e9efdd5fd3661800", 3812, 3840, 2356, 2688, 44, 1640}, + //offsets for: /mysql/5.5.12/bin/mysqld (5.5.12) + {"5.5.12","c95e1181fadd0a04fe2c7a153058b6f3", 3812, 3840, 2356, 2688, 44, 1640}, + //offsets for: /mysql/5.5.13/bin/mysqld (5.5.13) + {"5.5.13","d22b9d5bccd9f8bdb3158a87edd0992e", 3812, 3840, 2356, 2688, 44, 1640}, + //offsets for: /mysql/5.5.14/bin/mysqld (5.5.14) + {"5.5.14","e77fa342d52bd3a7cbd551b8a9649e40", 3812, 3840, 2356, 2688, 44, 1640}, + //offsets for: /mysql/5.5.15/bin/mysqld (5.5.15) + {"5.5.15","f070920da92c8fdf920f516bfbf7cbb4", 3812, 3840, 2356, 2688, 44, 1640}, + //offsets for: /mysql/5.5.16/bin/mysqld (5.5.16) + {"5.5.16","291c0f871da9691a2271d48e79d7cf2b", 3804, 3832, 2356, 2688, 44, 1640}, + //offsets for: /mysql/5.5.17/bin/mysqld (5.5.17) + {"5.5.17","64fde4494dbdd3e05457df5ac93c7760", 3804, 3832, 2356, 2688, 44, 1640}, + //offsets for: /mysql/5.5.18/bin/mysqld (5.5.18) + {"5.5.18","5f6f2516ff4728f3b04613ed66233aa5", 3804, 3832, 2356, 2688, 44, 1640}, + //offsets for: /mysql/5.5.19/bin/mysqld (5.5.19) {"5.5.19","b407d678b9b855bfd29ba3c9f014d4b0", 3808, 3836, 2360, 2692, 44, 1640}, - //offsets for: /mysql/5.5.20/bin/mysqld (5.5.20) - {"5.5.20","cb9b6887ea525fe9965121d357163fe4", 3808, 3836, 2360, 2692, 44, 1640}, - //offsets for: mysql/5.5.21/bin/mysqld (5.5.21) + //offsets for: /mysql/5.5.20/bin/mysqld (5.5.20) + {"5.5.20","cb9b6887ea525fe9965121d357163fe4", 3808, 3836, 2360, 2692, 44, 1640}, + //offsets for: mysql/5.5.21/bin/mysqld (5.5.21) {"5.5.21","a0762cee3ad5d4e77480956144900213", 3808, 3836, 2360, 2692, 44, 1640}, //offsets for: /mysql/5.5.22/bin/mysqld (5.5.22) {"5.5.22","f635047c7ddf74dcac98612a65e40fe1", 3808, 3836, 2360, 2692, 44, 1640}, @@ -664,7 +666,7 @@ __attribute__ ((noinline)) static int trampoline_send_result_to_client(Query_ca } #if MYSQL_VERSION_ID > 50505 -__attribute__ ((noinline)) static bool trampoline_open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags, +__attribute__ ((noinline)) static bool trampoline_open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags, Prelocking_strategy *prelocking_strategy) { TRAMPOLINE_NOP_DEF; @@ -758,7 +760,7 @@ static int audit_send_result_to_client(Query_cache *pthis, THD *thd, char *sql, static unsigned int trampoline_send_result_to_client_size =0; #if MYSQL_VERSION_ID > 50505 -static bool audit_open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags, +static bool audit_open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags, Prelocking_strategy *prelocking_strategy) { @@ -833,7 +835,7 @@ void remove_hot_functions () #endif #if MYSQL_VERSION_ID > 50505 - target_function = (void *)*(bool (*)(THD *thd, TABLE_LIST **start, uint *counter, uint flags, + target_function = (void *)*(bool (*)(THD *thd, TABLE_LIST **start, uint *counter, uint flags, Prelocking_strategy *prelocking_strategy)) &open_tables; remove_hot_patch_function(target_function, (void*) trampoline_open_tables, trampoline_open_tables_size, true, log_prefix); @@ -994,47 +996,47 @@ static bool audit_acl_authenticate(THD *thd, uint connect_errors, uint com_chang static bool parse_thd_offsets_string (char *poffsets_string) { - - char offset_str [2048] = {0}; - char *poffset_str = offset_str; - strncpy (poffset_str,poffsets_string,2048); - char * comma_delimiter = strchr (poffset_str,','); - int i =0; - OFFSET *pOffset; - size_t len = strlen (poffset_str); - - for (int j=0;j= '0' && poffset_str[j] <='9') || poffset_str[j] == ' ' || poffset_str[j] == ',')) - return false; - } - while (comma_delimiter !=NULL) - { - *comma_delimiter = '\0'; - pOffset = (OFFSET*)&Audit_formatter::thd_offsets.query_id + i; - if ((size_t)pOffset- (size_t)&Audit_formatter::thd_offsets < sizeof (Audit_formatter::thd_offsets)) - { - sscanf (poffset_str, "%d", pOffset); - } - else - { - return false; - } - i++; - poffset_str = comma_delimiter + 1; - comma_delimiter = strchr (poffset_str,','); - } - if (poffset_str !=NULL) - { - pOffset = &Audit_formatter::thd_offsets.query_id + i; - if ((size_t)pOffset- (size_t)&Audit_formatter::thd_offsets < sizeof (Audit_formatter::thd_offsets)) - { - sscanf (poffset_str, "%d", pOffset); - } - else - { - return false; - } + + char offset_str [2048] = {0}; + char *poffset_str = offset_str; + strncpy (poffset_str,poffsets_string,2048); + char * comma_delimiter = strchr (poffset_str,','); + int i =0; + OFFSET *pOffset; + size_t len = strlen (poffset_str); + + for (int j=0;j= '0' && poffset_str[j] <='9') || poffset_str[j] == ' ' || poffset_str[j] == ',')) + return false; + } + while (comma_delimiter !=NULL) + { + *comma_delimiter = '\0'; + pOffset = (OFFSET*)&Audit_formatter::thd_offsets.query_id + i; + if ((size_t)pOffset- (size_t)&Audit_formatter::thd_offsets < sizeof (Audit_formatter::thd_offsets)) + { + sscanf (poffset_str, "%d", pOffset); + } + else + { + return false; + } + i++; + poffset_str = comma_delimiter + 1; + comma_delimiter = strchr (poffset_str,','); + } + if (poffset_str !=NULL) + { + pOffset = &Audit_formatter::thd_offsets.query_id + i; + if ((size_t)pOffset- (size_t)&Audit_formatter::thd_offsets < sizeof (Audit_formatter::thd_offsets)) + { + sscanf (poffset_str, "%d", pOffset); + } + else + { + return false; + } } return true; } @@ -1230,70 +1232,70 @@ static int setup_offsets() } -const char * retrieve_command (THD * thd) -{ - const char *cmd = NULL; - - int command = Audit_formatter::thd_inst_command(thd); - if (command < 0 || command > COM_END) - { - command = COM_END; - } - const int sql_command = thd_sql_command(thd); - if (sql_command >=0 && sql_command <= (MAX_COM_STATUS_VARS_RECORDS -1) ) - { - cmd = com_status_vars_array[sql_command + 1].name; - } - if(!cmd) - { - cmd = command_name[command].str; - } - Security_context * sctx = Audit_formatter::thd_inst_main_security_ctx(thd); - if (strcmp (cmd, "Connect") ==0 && (sctx->priv_user == NULL || *sctx->priv_user == 0x0)) - { - cmd = "Failed Login"; - } - return cmd; +const char * retrieve_command (THD * thd) +{ + const char *cmd = NULL; + + int command = Audit_formatter::thd_inst_command(thd); + if (command < 0 || command > COM_END) + { + command = COM_END; + } + const int sql_command = thd_sql_command(thd); + if (sql_command >=0 && sql_command <= (MAX_COM_STATUS_VARS_RECORDS -1) ) + { + cmd = com_status_vars_array[sql_command + 1].name; + } + if(!cmd) + { + cmd = command_name[command].str; + } + Security_context * sctx = Audit_formatter::thd_inst_main_security_ctx(thd); + if (strcmp (cmd, "Connect") ==0 && (sctx->priv_user == NULL || *sctx->priv_user == 0x0)) + { + cmd = "Failed Login"; + } + return cmd; } static int set_com_status_vars_array () { DBUG_ENTER("set_com_status_vars_array"); - SHOW_VAR *com_status_vars; + SHOW_VAR *com_status_vars; int sv_idx =0; - while (strcmp (status_vars[sv_idx].name,"Com") !=0 && status_vars[sv_idx].name != NullS) - { - sv_idx ++; - } - if (strcmp (status_vars[sv_idx].name,"Com")==0) - { - int status_vars_index =0; - com_status_vars = (SHOW_VAR*)status_vars[sv_idx].value; - size_t initial_offset = (size_t) com_status_vars[0].value; - while (com_status_vars[status_vars_index].name != NullS) - { - int sql_command_idx = (com_status_vars[status_vars_index].value - (char*) (initial_offset)) / sizeof (ulong); - if (sql_command_idx >=0 && sql_command_idx < MAX_COM_STATUS_VARS_RECORDS) - { - com_status_vars_array [sql_command_idx].name = com_status_vars[status_vars_index].name; - com_status_vars_array [sql_command_idx].type = com_status_vars[status_vars_index].type; - com_status_vars_array [sql_command_idx].value = com_status_vars[status_vars_index].value; - } - else + while (strcmp (status_vars[sv_idx].name,"Com") !=0 && status_vars[sv_idx].name != NullS) + { + sv_idx ++; + } + if (strcmp (status_vars[sv_idx].name,"Com")==0) + { + int status_vars_index =0; + com_status_vars = (SHOW_VAR*)status_vars[sv_idx].value; + size_t initial_offset = (size_t) com_status_vars[0].value; + while (com_status_vars[status_vars_index].name != NullS) + { + int sql_command_idx = (com_status_vars[status_vars_index].value - (char*) (initial_offset)) / sizeof (ulong); + if (sql_command_idx >=0 && sql_command_idx < MAX_COM_STATUS_VARS_RECORDS) + { + com_status_vars_array [sql_command_idx].name = com_status_vars[status_vars_index].name; + com_status_vars_array [sql_command_idx].type = com_status_vars[status_vars_index].type; + com_status_vars_array [sql_command_idx].value = com_status_vars[status_vars_index].value; + } + else { sql_print_error("%s Failed sql_command_idx [%d] is out of bounds. Plugin Init failed.", - log_prefix, sql_command_idx); - DBUG_RETURN (1); - } - status_vars_index ++; - } - - } - else + log_prefix, sql_command_idx); + DBUG_RETURN (1); + } + status_vars_index ++; + } + + } + else { sql_print_error("%s Failed looking up 'Com' entry in status_vars. Plugin Init failed.", - log_prefix); - DBUG_RETURN (1); + log_prefix); + DBUG_RETURN (1); } DBUG_RETURN (0); } @@ -1508,7 +1510,7 @@ static int audit_plugin_init(void *p) log_prefix, trampoline_check_table_access_size); #if MYSQL_VERSION_ID > 50505 - target_function = (void *)*(bool (*)(THD *thd, TABLE_LIST **start, uint *counter, uint flags, + target_function = (void *)*(bool (*)(THD *thd, TABLE_LIST **start, uint *counter, uint flags, Prelocking_strategy *prelocking_strategy)) &open_tables; res = hot_patch_function(target_function, (void*) audit_open_tables, @@ -1523,7 +1525,7 @@ static int audit_plugin_init(void *p) } sql_print_information( "%s hot patch open_tables address %p. Trampoline size: %u.", - log_prefix, *(bool (*)(THD *thd, TABLE_LIST **start, uint *counter, uint flags, + log_prefix, *(bool (*)(THD *thd, TABLE_LIST **start, uint *counter, uint flags, Prelocking_strategy *prelocking_strategy)) &open_tables, trampoline_open_tables_size); #else @@ -1784,8 +1786,8 @@ extern "C" void __attribute__ ((constructor)) audit_plugin_so_init(void) extern struct st_mysql_plugin *mysql_mandatory_plugins[]; extern "C" void __attribute__ ((constructor)) audit_plugin_so_init(void) { - - + + audit_plugin.interface_version = *(int *) mysql_mandatory_plugins[0]->info; sql_print_information("%s Set interface version to: %d (%d)", log_prefix, audit_plugin.interface_version, diff --git a/src/hot_patch.cc b/src/hot_patch.cc index 10bb52a..4dfbd03 100644 --- a/src/hot_patch.cc +++ b/src/hot_patch.cc @@ -1,196 +1,196 @@ -#include "hot_patch.h" -#include "udis86.h" - -#define UINT unsigned int -#define DWORD uint32_t -#define BYTE unsigned char -#ifdef __x86_64__ -#define ULONG_PTR uint64_t -#else -#define ULONG_PTR uint32_t -#endif - - - -#define unprotect(addr,len) (mprotect(addr,len,PROT_READ|PROT_WRITE|PROT_EXEC)) -#define protect(addr,len) (mprotect(addr,len,PROT_READ|PROT_EXEC)) -#define GETPAGESIZE() sysconf (_SC_PAGE_SIZE) - -static const unsigned long PAGE_SIZE = GETPAGESIZE() ; - -//macro to log via sql_print_information only if cond test is enabled -#define cond_info_print(cond_test, ...) do{if(cond_test) sql_print_information(__VA_ARGS__);}while(0) - - -/* - * Get the page address of a given pointer - */ -static DATATYPE_ADDRESS get_page_address(void * pointer) -{ - DATATYPE_ADDRESS pageMask = ( ~(PAGE_SIZE - 1) ) ; - DATATYPE_ADDRESS longp = (unsigned long) pointer; - return (longp & pageMask); -} - -// -// This function retrieves the necessary size for the jump -// - -static UINT GetJumpSize(ULONG_PTR PosA, ULONG_PTR PosB) -{ -#ifndef __x86_64__ - return 5; -#else - return 14; -#endif -} - -// -// This function writes unconditional jumps -// both for x86 and x64 -// - -static void WriteJump(void *pAddress, ULONG_PTR JumpTo) -{ - DWORD dwOldProtect = 0; - DATATYPE_ADDRESS AddressPage = get_page_address(pAddress); - unprotect((void*)AddressPage, PAGE_SIZE); - - BYTE *pCur = (BYTE *) pAddress; -#ifndef __x86_64__ - - BYTE * pbJmpSrc = pCur + 5; - *pCur++ = 0xE9; // jmp +imm32 - *((ULONG_PTR *)pCur) = JumpTo - (ULONG_PTR)pbJmpSrc; - -#else - - *pCur = 0xff; // jmp [rip+addr] - *(++pCur) = 0x25; - *((DWORD *) ++pCur) = 0; // addr = 0 - pCur += sizeof (DWORD); - *((ULONG_PTR *)pCur) = JumpTo; - -#endif - //} - - DWORD dwBuf = 0; // nessary othewrise the function fails - - protect((void*)AddressPage, PAGE_SIZE); -} - -// -// Hooks a function -// -static bool HookFunction(ULONG_PTR targetFunction, ULONG_PTR newFunction, ULONG_PTR trampolineFunction, unsigned int *trampolinesize) -{ - #define MAX_INSTRUCTIONS 100 - uint8_t raw[MAX_INSTRUCTIONS]; - unsigned int uCurrentSize =0; - -#ifndef __x86_64__ - #define ASM_MODE 32 -#else - #define ASM_MODE 64 -#endif - memcpy (raw,(void*)targetFunction,MAX_INSTRUCTIONS); - ud_t ud_obj; - ud_init(&ud_obj); - ud_set_input_buffer(&ud_obj, raw, MAX_INSTRUCTIONS); - ud_set_mode(&ud_obj, ASM_MODE); - ud_set_syntax(&ud_obj, UD_SYN_INTEL); - - - DWORD InstrSize = 0; - DATATYPE_ADDRESS trampolineFunctionPage = get_page_address((void*)trampolineFunction); - unprotect((void*)trampolineFunctionPage, PAGE_SIZE); - while (ud_disassemble(&ud_obj) && (strncmp (ud_insn_asm(&ud_obj),"invalid",7)!=0)) - { - if (InstrSize >= GetJumpSize(targetFunction, newFunction)) - break; - - BYTE *pCurInstr = (BYTE *) (InstrSize + (ULONG_PTR) targetFunction); - memcpy((BYTE*)trampolineFunction + uCurrentSize, - (void *) pCurInstr, ud_insn_len (&ud_obj)); - - uCurrentSize += ud_insn_len (&ud_obj); - - - InstrSize += ud_insn_len (&ud_obj); - } - protect((void*)trampolineFunctionPage, PAGE_SIZE); - WriteJump( (BYTE*)trampolineFunction + uCurrentSize, targetFunction + InstrSize); - WriteJump((void *) targetFunction, newFunction); - *trampolinesize = uCurrentSize; - return true; -} - -// -// Unhooks a function -// - - -static void UnhookFunction(ULONG_PTR Function,ULONG_PTR trampolineFunction , unsigned int trampolinesize) -{ - DATATYPE_ADDRESS FunctionPage = get_page_address((void*)Function); - unprotect((void*)FunctionPage, PAGE_SIZE); - memcpy((void *) Function, (void*)trampolineFunction,trampolinesize); - protect((void*)FunctionPage, PAGE_SIZE); -} - -/** - * Hot patch a function. - * - * We are basically taking the code of the target function and putting at the start a jump to our new function. - * Additionally we generate a trampoline function which the target function can call inorder to call the original function. - * - * trampolineFunction will be modified to contain the original code + jump code - * - * @param targetFunction the function to hot patch - * @param newFunction the new function to be called instead of the targetFunction - * @param trampolineFunction a function which will contain a jump back to the targetFunction. Function need to have - * enough space of TRAMPOLINE_COPY_LENGTH + MIN_REQUIRED_FOR_DETOUR. Recommended to use a static function - * which contains a bunch of nops. Use macro: TRAMPOLINE_NOP_DEF - * @param log_file if not null will log about progress of installing the plugin - * @Return 0 on success otherwise failure - * @See MS Detours paper: http://research.microsoft.com/pubs/68568/huntusenixnt99.pdf for some background info. - */ -int hot_patch_function (void* targetFunction, void* newFunction, void * trampolineFunction, unsigned int *trampolinesize, bool info_print, const char * log_prefix) -{ - cond_info_print(info_print, "%s hot patching function: 0x%x", log_prefix, targetFunction); - DATATYPE_ADDRESS trampolinePage = get_page_address(trampolineFunction); - cond_info_print(info_print, "%s trampolineFunction: 0x%x trampolinePage: 0x%x",log_prefix, trampolineFunction, trampolinePage); - if (HookFunction((ULONG_PTR) targetFunction, (ULONG_PTR) newFunction, - (ULONG_PTR) trampolineFunction, trampolinesize)) - { - return 0; - } - else - { - return -1; - } -} - - -/** - * Restore a function back to its orginal state. Based uppon a trampoline function which - * contains a copy of the original code. - * - * @param targetFunction the function to fix back - * @param trampolineFunction a function which contains a jump back to the targetFunction. - * @param log_file if not null will log about progress of installing the plugin - */ -void remove_hot_patch_function (void* targetFunction, void * trampolineFunction, unsigned int trampolinesize, bool info_print, const char * log_prefix) -{ - if(trampolinesize == 0) - { - //nothing todo. As hot patch was not set. - return; - } - cond_info_print(info_print, "%s removing hot patching function: 0x%x",log_prefix, targetFunction); - DATATYPE_ADDRESS targetPage = get_page_address(targetFunction); - cond_info_print(info_print, "%s targetPage: 0x%x targetFunction: 0x%x",log_prefix, targetPage, targetFunction); - - UnhookFunction ((ULONG_PTR) targetFunction, (ULONG_PTR)trampolineFunction,trampolinesize); - return; -} +#include "hot_patch.h" +#include "udis86.h" + +#define UINT unsigned int +#define DWORD uint32_t +#define BYTE unsigned char +#ifdef __x86_64__ +#define ULONG_PTR uint64_t +#else +#define ULONG_PTR uint32_t +#endif + + + +#define unprotect(addr,len) (mprotect(addr,len,PROT_READ|PROT_WRITE|PROT_EXEC)) +#define protect(addr,len) (mprotect(addr,len,PROT_READ|PROT_EXEC)) +#define GETPAGESIZE() sysconf (_SC_PAGE_SIZE) + +static const unsigned long PAGE_SIZE = GETPAGESIZE() ; + +//macro to log via sql_print_information only if cond test is enabled +#define cond_info_print(cond_test, ...) do{if(cond_test) sql_print_information(__VA_ARGS__);}while(0) + + +/* + * Get the page address of a given pointer + */ +static DATATYPE_ADDRESS get_page_address(void * pointer) +{ + DATATYPE_ADDRESS pageMask = ( ~(PAGE_SIZE - 1) ) ; + DATATYPE_ADDRESS longp = (unsigned long) pointer; + return (longp & pageMask); +} + +// +// This function retrieves the necessary size for the jump +// + +static UINT GetJumpSize(ULONG_PTR PosA, ULONG_PTR PosB) +{ +#ifndef __x86_64__ + return 5; +#else + return 14; +#endif +} + +// +// This function writes unconditional jumps +// both for x86 and x64 +// + +static void WriteJump(void *pAddress, ULONG_PTR JumpTo) +{ + DWORD dwOldProtect = 0; + DATATYPE_ADDRESS AddressPage = get_page_address(pAddress); + unprotect((void*)AddressPage, PAGE_SIZE); + + BYTE *pCur = (BYTE *) pAddress; +#ifndef __x86_64__ + + BYTE * pbJmpSrc = pCur + 5; + *pCur++ = 0xE9; // jmp +imm32 + *((ULONG_PTR *)pCur) = JumpTo - (ULONG_PTR)pbJmpSrc; + +#else + + *pCur = 0xff; // jmp [rip+addr] + *(++pCur) = 0x25; + *((DWORD *) ++pCur) = 0; // addr = 0 + pCur += sizeof (DWORD); + *((ULONG_PTR *)pCur) = JumpTo; + +#endif + //} + + DWORD dwBuf = 0; // nessary othewrise the function fails + + protect((void*)AddressPage, PAGE_SIZE); +} + +// +// Hooks a function +// +static bool HookFunction(ULONG_PTR targetFunction, ULONG_PTR newFunction, ULONG_PTR trampolineFunction, unsigned int *trampolinesize) +{ + #define MAX_INSTRUCTIONS 100 + uint8_t raw[MAX_INSTRUCTIONS]; + unsigned int uCurrentSize =0; + +#ifndef __x86_64__ + #define ASM_MODE 32 +#else + #define ASM_MODE 64 +#endif + memcpy (raw,(void*)targetFunction,MAX_INSTRUCTIONS); + ud_t ud_obj; + ud_init(&ud_obj); + ud_set_input_buffer(&ud_obj, raw, MAX_INSTRUCTIONS); + ud_set_mode(&ud_obj, ASM_MODE); + ud_set_syntax(&ud_obj, UD_SYN_INTEL); + + + DWORD InstrSize = 0; + DATATYPE_ADDRESS trampolineFunctionPage = get_page_address((void*)trampolineFunction); + unprotect((void*)trampolineFunctionPage, PAGE_SIZE); + while (ud_disassemble(&ud_obj) && (strncmp (ud_insn_asm(&ud_obj),"invalid",7)!=0)) + { + if (InstrSize >= GetJumpSize(targetFunction, newFunction)) + break; + + BYTE *pCurInstr = (BYTE *) (InstrSize + (ULONG_PTR) targetFunction); + memcpy((BYTE*)trampolineFunction + uCurrentSize, + (void *) pCurInstr, ud_insn_len (&ud_obj)); + + uCurrentSize += ud_insn_len (&ud_obj); + + + InstrSize += ud_insn_len (&ud_obj); + } + protect((void*)trampolineFunctionPage, PAGE_SIZE); + WriteJump( (BYTE*)trampolineFunction + uCurrentSize, targetFunction + InstrSize); + WriteJump((void *) targetFunction, newFunction); + *trampolinesize = uCurrentSize; + return true; +} + +// +// Unhooks a function +// + + +static void UnhookFunction(ULONG_PTR Function,ULONG_PTR trampolineFunction , unsigned int trampolinesize) +{ + DATATYPE_ADDRESS FunctionPage = get_page_address((void*)Function); + unprotect((void*)FunctionPage, PAGE_SIZE); + memcpy((void *) Function, (void*)trampolineFunction,trampolinesize); + protect((void*)FunctionPage, PAGE_SIZE); +} + +/** + * Hot patch a function. + * + * We are basically taking the code of the target function and putting at the start a jump to our new function. + * Additionally we generate a trampoline function which the target function can call inorder to call the original function. + * + * trampolineFunction will be modified to contain the original code + jump code + * + * @param targetFunction the function to hot patch + * @param newFunction the new function to be called instead of the targetFunction + * @param trampolineFunction a function which will contain a jump back to the targetFunction. Function need to have + * enough space of TRAMPOLINE_COPY_LENGTH + MIN_REQUIRED_FOR_DETOUR. Recommended to use a static function + * which contains a bunch of nops. Use macro: TRAMPOLINE_NOP_DEF + * @param log_file if not null will log about progress of installing the plugin + * @Return 0 on success otherwise failure + * @See MS Detours paper: http://research.microsoft.com/pubs/68568/huntusenixnt99.pdf for some background info. + */ +int hot_patch_function (void* targetFunction, void* newFunction, void * trampolineFunction, unsigned int *trampolinesize, bool info_print, const char * log_prefix) +{ + cond_info_print(info_print, "%s hot patching function: 0x%x", log_prefix, targetFunction); + DATATYPE_ADDRESS trampolinePage = get_page_address(trampolineFunction); + cond_info_print(info_print, "%s trampolineFunction: 0x%x trampolinePage: 0x%x",log_prefix, trampolineFunction, trampolinePage); + if (HookFunction((ULONG_PTR) targetFunction, (ULONG_PTR) newFunction, + (ULONG_PTR) trampolineFunction, trampolinesize)) + { + return 0; + } + else + { + return -1; + } +} + + +/** + * Restore a function back to its orginal state. Based uppon a trampoline function which + * contains a copy of the original code. + * + * @param targetFunction the function to fix back + * @param trampolineFunction a function which contains a jump back to the targetFunction. + * @param log_file if not null will log about progress of installing the plugin + */ +void remove_hot_patch_function (void* targetFunction, void * trampolineFunction, unsigned int trampolinesize, bool info_print, const char * log_prefix) +{ + if(trampolinesize == 0) + { + //nothing todo. As hot patch was not set. + return; + } + cond_info_print(info_print, "%s removing hot patching function: 0x%x",log_prefix, targetFunction); + DATATYPE_ADDRESS targetPage = get_page_address(targetFunction); + cond_info_print(info_print, "%s targetPage: 0x%x targetFunction: 0x%x",log_prefix, targetPage, targetFunction); + + UnhookFunction ((ULONG_PTR) targetFunction, (ULONG_PTR)trampolineFunction,trampolinesize); + return; +}