diff --git a/include/audit_handler.h b/include/audit_handler.h index 20aa329..e8638fa 100644 --- a/include/audit_handler.h +++ b/include/audit_handler.h @@ -1,691 +1,675 @@ -/* - * audit_handler.h - * - * Created on: Feb 6, 2011 - * Author: guyl - */ - -#ifndef AUDIT_HANDLER_H_ -#define AUDIT_HANDLER_H_ - -#include "mysql_inc.h" -#include - -#ifndef PCRE_STATIC -#define PCRE_STATIC -#endif - -#include - -#define AUDIT_LOG_PREFIX "Audit Plugin:" -#define AUDIT_PROTOCOL_VERSION "1.0" - -#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50709 -// For locking we use the native lock routines provided by MySQL. -// The data types and functions for native locking changed at 5.7.x. -// Try to hide this with macros. -#define rw_lock_t native_rw_lock_t -#define rw_rdlock native_rw_rdlock -#define rw_wrlock native_rw_wrlock -#define rw_unlock native_rw_unlock -#define rwlock_destroy native_rw_destroy -#define my_rwlock_init(lock, unused) native_rw_init(lock) -#endif - -class THD; - -#define MAX_NUM_QUERY_TABLE_ELEM 100 -typedef struct _QueryTableInf { - int num_of_elem; - char *db[MAX_NUM_QUERY_TABLE_ELEM]; - char *table_name[MAX_NUM_QUERY_TABLE_ELEM]; - const char *object_type [MAX_NUM_QUERY_TABLE_ELEM]; -} QueryTableInf; - -#define MAX_NUM_QUEUE_ELEM 1024 -typedef struct _THDPRINTED { - size_t cur_index; - char is_thd_printed_queue [MAX_NUM_QUEUE_ELEM]; -} THDPRINTED; - -#define MAX_COMMAND_CHAR_NUMBERS 40 -const char * retrieve_command (THD * thd, bool & is_sql_cmd); -typedef size_t OFFSET; - -#define MAX_COM_STATUS_VARS_RECORDS 512 - -//mysql max identifier is 64 so 2*64 + . and null -#define MAX_OBJECT_CHAR_NUMBERS 131 -#define MAX_USER_CHAR_NUMBERS 20 -#define MAX_NUM_OBJECT_ELEM 256 -#define MAX_NUM_USER_ELEM 256 - -/** - * The struct used to hold offsets. We should have one per version. - */ -typedef struct ThdOffsets -{ - const char * version; - const char * md5digest; - OFFSET query_id; - OFFSET thread_id; - OFFSET main_security_ctx; - OFFSET command; - OFFSET lex; - OFFSET lex_comment; - OFFSET sec_ctx_user; - OFFSET sec_ctx_host; - OFFSET sec_ctx_ip; - OFFSET sec_ctx_priv_user; - OFFSET db; - OFFSET killed; -} ThdOffsets; - -/* - * The offsets array - */ -extern const ThdOffsets thd_offsets_arr[]; -extern const size_t thd_offsets_arr_size; - -/* - * On success, the number of bytes written are returned (zero indicates nothing was written). On error, -1 is returned, - */ -typedef ssize_t (*audit_write_func)(const char *, size_t); - - -/** - * Interface for an io writer - */ -class IWriter -{ -public: - virtual ~IWriter() {} - //return negative on fail - virtual ssize_t write(const char * data, size_t size) = 0; - inline ssize_t write_str(const char * str) - { - return write(str, strlen(str)); - } - //return 0 on success - virtual int open(const char * io_dest, bool log_errors) = 0; - virtual void close() = 0; -}; - -class ThdSesData { -public: - - //enum indicating from where the object list came from - enum ObjectIterType {OBJ_NONE, OBJ_DB, OBJ_QUERY_CACHE, OBJ_TABLE_LIST}; - ThdSesData(THD *pTHD); - THD* getTHD () { return m_pThd;} - const char * getCmdName () { return m_CmdName; } - const char * getUserName () { return m_UserName; } - /** - * Start fetching objects. Return true if there are objects available. - */ - bool startGetObjects(); - /** - * Get next object. Return true if populated. False if there isn't an object available. - * Will point the passed pointers to point to db, name and type. - * obj_type is optional and may be null. - */ - bool getNextObject(const char ** db_name, const char ** obj_name, const char ** obj_type); -private: - THD *m_pThd; - const char *m_CmdName; - const char *m_UserName; - bool m_isSqlCmd; - enum ObjectIterType m_objIterType; - //pointer for iterating tables - TABLE_LIST * m_tables; - //indicator if we are at the first table - bool m_firstTable; - //used for query cache iter - QueryTableInf * m_tableInf; - int m_index; -protected: - ThdSesData (const ThdSesData& ); - ThdSesData &operator =(const ThdSesData& ); -}; - -/** - * Base for audit formatter - */ -class Audit_formatter -{ -public: - - virtual ~Audit_formatter() {} - - /** - * static offsets to use for fetching THD data. Set by the audit plugin during startup. - */ - static ThdOffsets thd_offsets; - - /** - * Format an audit event from the passed THD. Will write out its output using the audit_write_func. - * - * @return -1 on a failure - */ - virtual ssize_t event_format(ThdSesData *pThdData, IWriter * writer) =0; - /** - * format a message when handler is started - * @return -1 on a failure - */ - virtual ssize_t start_msg_format(IWriter * writer) { return 0; } - /** - * format a message when handler is stopped - * @return -1 on a failure - */ - virtual ssize_t stop_msg_format(IWriter * writer) { return 0; } - - static const char * retrieve_object_type (TABLE_LIST *pObj); - static QueryTableInf* getQueryCacheTableList1 (THD *thd); - //utility functions for fetching thd stuff - static inline my_thread_id thd_inst_thread_id(THD * thd) - { - return *(my_thread_id *) (((unsigned char *) thd) - + Audit_formatter::thd_offsets.thread_id); - } - static inline query_id_t thd_inst_query_id(THD * thd) - { - return *(query_id_t *) (((unsigned char *) thd) - + Audit_formatter::thd_offsets.query_id); - } - static inline Security_context * thd_inst_main_security_ctx(THD * thd) - { - return (Security_context *) (((unsigned char *) thd) - + Audit_formatter::thd_offsets.main_security_ctx); - } - - static inline const char * thd_db(THD * thd) - { - if(!Audit_formatter::thd_offsets.db) //no offsets use compiled in header - { -#if defined(MARIADB_BASE_VERSION) || MYSQL_VERSION_ID < 50709 - return thd->db; -#else - return thd->db().str; -#endif - } - return *(const char **) (((unsigned char *) thd) - + Audit_formatter::thd_offsets.db); - } - - static inline int thd_killed(THD * thd) - { - if(!Audit_formatter::thd_offsets.killed) //no offsets use thd_killed function - { - return ::thd_killed(thd); - } - return *(int *) (((unsigned char *) thd) - + Audit_formatter::thd_offsets.killed); - } - - static inline const char * thd_inst_main_security_ctx_user(THD * thd) - { - Security_context * sctx = thd_inst_main_security_ctx(thd); - if(!Audit_formatter::thd_offsets.sec_ctx_user) //no offsets use compiled in header - { -#if defined(MARIADB_BASE_VERSION) || MYSQL_VERSION_ID < 50709 - return sctx->user; -#else - return sctx->user().str; -#endif - } - return *(const char **) (((unsigned char *) sctx) - + Audit_formatter::thd_offsets.sec_ctx_user); - } - - static inline const char * thd_inst_main_security_ctx_host(THD * thd) - { - Security_context * sctx = thd_inst_main_security_ctx(thd); - if(!Audit_formatter::thd_offsets.sec_ctx_ip) //check ip to understand if set as host is first and may actually be set to 0 - { - //interface changed in 5.5.34 and 5.6.14 and up host changed to get_host() - //see: http://bazaar.launchpad.net/~mysql/mysql-server/5.5/revision/4407.1.1/sql/sql_class.h -#if defined(MARIADB_BASE_VERSION) - return sctx->host; -#else - // MySQL -#if MYSQL_VERSION_ID < 50534 || (MYSQL_VERSION_ID >= 50600 && MYSQL_VERSION_ID < 50614) - return sctx->host; -#elif (MYSQL_VERSION_ID >= 50534 && MYSQL_VERSION_ID < 50600) \ - || (MYSQL_VERSION_ID >= 50614 && MYSQL_VERSION_ID < 50709) - return sctx->get_host()->ptr(); -#else - // interface changed again in 5.7 - return sctx->host().str; -#endif -#endif // ! defined(MARIADB_BASE_VERSION) - } - return *(const char **) (((unsigned char *) sctx) - + Audit_formatter::thd_offsets.sec_ctx_host); - } - - static inline const char * thd_inst_main_security_ctx_ip(THD * thd) - { - Security_context * sctx = thd_inst_main_security_ctx(thd); - if(!Audit_formatter::thd_offsets.sec_ctx_ip) //no offsets use compiled in header - { -//interface changed in 5.5.34 and 5.6.14 and up host changed to get_ip() -#if defined(MARIADB_BASE_VERSION) - return sctx->ip; -#else - // MySQL -#if MYSQL_VERSION_ID < 50534 || (MYSQL_VERSION_ID >= 50600 && MYSQL_VERSION_ID < 50614) - return sctx->ip; -#elif (MYSQL_VERSION_ID >= 50534 && MYSQL_VERSION_ID < 50600) \ - || (MYSQL_VERSION_ID >= 50614 && MYSQL_VERSION_ID < 50709) - return sctx->get_ip()->ptr(); -#else - // interface changed again in 5.7 - return sctx->ip().str; -#endif -#endif // ! defined(MARIADB_BASE_VERSION) - } - return *(const char **) (((unsigned char *) sctx) - + Audit_formatter::thd_offsets.sec_ctx_ip); - } - - static inline const char * thd_inst_main_security_ctx_priv_user(THD * thd) - { - Security_context * sctx = thd_inst_main_security_ctx(thd); - if(!Audit_formatter::thd_offsets.sec_ctx_priv_user) //no offsets use compiled in header - { -#if defined(MARIADB_BASE_VERSION) || MYSQL_VERSION_ID < 50709 - return sctx->priv_user; -#else - return sctx->priv_user().str; -#endif - } -#if MYSQL_VERSION_ID < 50505 - //in 5.1.x priv_user is a pointer - return *(const char **) (((unsigned char *) sctx) - + Audit_formatter::thd_offsets.sec_ctx_priv_user); -#else - //in 5.5 and up priv_user is an array (char priv_user[USERNAME_LENGTH]) - return (const char *) (((unsigned char *) sctx) - + Audit_formatter::thd_offsets.sec_ctx_priv_user); -#endif - } - - static inline int thd_inst_command(THD * thd) - { - return *(int *) (((unsigned char *) thd) + Audit_formatter::thd_offsets.command); - } - - static inline LEX* thd_lex(THD * thd) - { - return *(LEX**) (((unsigned char *) thd) + Audit_formatter::thd_offsets.lex); - } - - //we don't use get_db_name() as when we call it view may be not null and it may return an invalid value for view_db - static inline const char * table_get_db_name(TABLE_LIST * table) - { - return table->db; - } - - static inline const char * table_get_name(TABLE_LIST * table) - { - return table->table_name; - } - - static inline bool table_is_view(TABLE_LIST * table) - { - return table->view_tables != 0; - } - -}; - - -/** - * Format the audit even in json format - */ -class Audit_json_formatter: public Audit_formatter -{ -public: - - static const char * DEF_MSG_DELIMITER; - - Audit_json_formatter(): m_msg_delimiter(NULL), m_write_start_msg(true), m_password_mask_regex_preg(NULL), - m_password_mask_regex_compiled(false), m_perform_password_masking(NULL) - { - config.beautify = 0; - config.indentString = NULL; - } - virtual ~Audit_json_formatter() - { - if(m_password_mask_regex_preg) - { - m_password_mask_regex_compiled = false; - pcre_free(m_password_mask_regex_preg); - m_password_mask_regex_preg = NULL; - } - } - - virtual ssize_t event_format(ThdSesData *pThdData, IWriter * writer); - virtual ssize_t start_msg_format(IWriter * writer); - - /** - * Utility method used to compile a regex program. Will compile and log errors if necessary. - * Return null if fails - */ - static pcre * regex_compile(const char * str); - - /** - * Compile password masking regex - * Return 0 on success - */ - int compile_password_masking_regex(const char * str); - - /** - * Boolean indicating if to log start msg. - * Public so sysvar can update. - */ - my_bool m_write_start_msg; - - - /** - * Callback function to determine if password masking should be performed - */ - my_bool (* m_perform_password_masking)(const char *cmd); - - /** - * Message delimiter. Should point to a valid json string (supporting the json escapping format). - * Will only be checked at the start. Public so can be set by sysvar. - * - * We only support a delimiter up to 32 chars - */ - char * m_msg_delimiter; - - /** - * Configuration of yajl. Leave public so sysvar can update this directly. - */ - yajl_gen_config config; - -protected: - - Audit_json_formatter& operator =(const Audit_json_formatter& b); - Audit_json_formatter(const Audit_json_formatter& ); - - /** - * Boolean indicating if password masking regex is compiled - */ - my_bool m_password_mask_regex_compiled; - - /** - * Regex used for password masking - */ - pcre * m_password_mask_regex_preg; - -}; - -/** - * Base class for audit handlers. Provides basic locking setup. - */ -class Audit_handler -{ -public: - - - - static const size_t MAX_AUDIT_HANDLERS_NUM = 4; - static const size_t JSON_FILE_HANDLER = 1; - static const size_t JSON_SOCKET_HANDLER = 3; - - static Audit_handler * m_audit_handler_list[]; - - /** - * Will iterate the handler list and log using each handler - */ - static void log_audit_all(ThdSesData *pThdData); - - /** - * Will iterate the handler list and stop all handlers - */ - static void stop_all(); - - Audit_handler() : - m_initialized(false), m_enabled(false), m_print_offset_err(true), m_formatter(NULL), m_failed(false), m_log_io_errors(true) - { - } - - virtual ~Audit_handler() - { - if (m_initialized) - { - rwlock_destroy(&LOCK_audit); - pthread_mutex_destroy(&LOCK_io); - } - } - - /** - * Should be called to initialize. We don't init in constructor in order to provide indication if - * pthread stuff failed init. - * - * @frmt the formatter to use in this handler (does not manage distruction of this object) - * @return 0 on success - */ - int init(Audit_formatter * frmt) - { - m_formatter = frmt; - if (m_initialized) - { - return 0; - } - int res = my_rwlock_init(&LOCK_audit, NULL); - if (res) - { - return res; - } - res = pthread_mutex_init(&LOCK_io, MY_MUTEX_INIT_SLOW);; - if (res) - { - return res; - } - m_initialized = true; - return res; - } - - bool is_init() - { - return m_initialized; - } - - void set_enable(bool val); - - bool is_enabled() - { - return m_enabled; - } - - /** - * will close and start the handler - */ - void flush(); - - /** - * Will get relevant shared lock and call internal method of handler - */ - void log_audit(ThdSesData *pThdData); - - /** - * Public so can be configured via sysvar - */ - unsigned int m_retry_interval; - -protected: - Audit_formatter * m_formatter; - virtual void handler_start(); - //wiil call internal method and set failed as needed - bool handler_start_nolock(); - virtual void handler_stop(); - virtual bool handler_start_internal() = 0; - virtual void handler_stop_internal() = 0; - virtual bool handler_log_audit(ThdSesData *pThdData) =0; - bool m_initialized; - bool m_enabled; - bool m_failed; - bool m_log_io_errors; - time_t m_last_retry_sec_ts; - inline void set_failed() - { - time(&m_last_retry_sec_ts); - m_failed = true; - m_log_io_errors = false; - } - inline bool is_failed_now() - { - return m_failed && (m_retry_interval < 0 || - difftime(time(NULL), m_last_retry_sec_ts) > m_retry_interval); - } - //override default assignment and copy to protect against creating additional instances - Audit_handler & operator=(const Audit_handler&); - Audit_handler(const Audit_handler&); -private: - //bool indicating if to print offset errors to log or not - bool m_print_offset_err; - //lock io - pthread_mutex_t LOCK_io; - //audit (enable) lock - rw_lock_t LOCK_audit; - inline void lock_shared() - { - rw_rdlock(&LOCK_audit); - } - inline void lock_exclusive() - { - rw_wrlock(&LOCK_audit); - } - inline void unlock() - { - rw_unlock(&LOCK_audit); - } -}; - -/** - * Base class for handler which have io and need a lock - */ -class Audit_io_handler: public Audit_handler, public IWriter -{ -public: - Audit_io_handler() : m_io_dest(NULL), m_io_type(NULL) - { - } - - virtual ~Audit_io_handler() - { - } - - - /** - * target we write to (socket/file). Public so we update via sysvar - */ - char * m_io_dest; - -protected: - virtual bool handler_start_internal(); - virtual void handler_stop_internal(); - //used for logging messages - const char * m_io_type; -}; - -class Audit_file_handler: public Audit_io_handler -{ -public: - - Audit_file_handler() : - m_sync_period(0), m_log_file(NULL), m_sync_counter(0), m_bufsize(0) - { - m_io_type = "file"; - } - - virtual ~Audit_file_handler() - { - } - - /** - * The period to use for syncing to the file system. 0 means we don't sync. - * 1 means each write we sync. Larger than 1 means every sync_period we sync. - * - * We leave this public so the mysql sysvar function can update this variable directly. - */ - unsigned int m_sync_period; - - /** - * The buf size used by the file stream. 0 = use default, negative or 1 = no buffering - */ - long m_bufsize; - - /** - * Write function we pass to formatter - */ - ssize_t write(const char * data, size_t size); - - void close(); - - int open(const char * io_dest, bool m_log_errors); - //static void print_sleep (THD *thd, int delay_ms); -protected: - //override default assignment and copy to protect against creating additional instances - Audit_file_handler & operator=(const Audit_file_handler&); - Audit_file_handler(const Audit_file_handler&); - - - - /** - * Will acquire locks and call handler_write - */ - virtual bool handler_log_audit(ThdSesData *pThdData); - FILE * m_log_file; - //the period to use for syncing - unsigned int m_sync_counter; - - -}; - -class Audit_socket_handler: public Audit_io_handler -{ -public: - - Audit_socket_handler() : - m_vio(NULL), m_connect_timeout(1) - { - m_io_type = "socket"; - } - - virtual ~Audit_socket_handler() - { - } - - - /** - * Connect timeout in secconds - */ - unsigned int m_connect_timeout; - - /** - * Write function we pass to formatter - */ - ssize_t write(const char * data, size_t size); - - void close(); - - int open(const char * io_dest, bool log_errors); -protected: - //override default assignment and copy to protect against creating additional instances - Audit_socket_handler & operator=(const Audit_socket_handler&); - Audit_socket_handler(const Audit_socket_handler&); - - /** - * Will acquire locks and call handler_write - */ - virtual bool handler_log_audit(ThdSesData *pThdData); - //Vio we write to - //define as void* so we don't access members directly - void * m_vio; -}; - -#endif /* AUDIT_HANDLER_H_ */ - +/* + * audit_handler.h + * + * Created on: Feb 6, 2011 + * Author: guyl + */ + +#ifndef AUDIT_HANDLER_H_ +#define AUDIT_HANDLER_H_ + +#include "mysql_inc.h" +#include + +#ifndef PCRE_STATIC +#define PCRE_STATIC +#endif + +#include + +#define AUDIT_LOG_PREFIX "Audit Plugin:" +#define AUDIT_PROTOCOL_VERSION "1.0" + +#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50709 +// For locking we use the native lock routines provided by MySQL. +// The data types and functions for native locking changed at 5.7.x. +// Try to hide this with macros. +#define rw_lock_t native_rw_lock_t +#define rw_rdlock native_rw_rdlock +#define rw_wrlock native_rw_wrlock +#define rw_unlock native_rw_unlock +#define rwlock_destroy native_rw_destroy +#define my_rwlock_init(lock, unused) native_rw_init(lock) +#endif + +class THD; + +#define MAX_NUM_QUERY_TABLE_ELEM 100 +typedef struct _QueryTableInf { + int num_of_elem; + char *db[MAX_NUM_QUERY_TABLE_ELEM]; + char *table_name[MAX_NUM_QUERY_TABLE_ELEM]; + const char *object_type [MAX_NUM_QUERY_TABLE_ELEM]; +} QueryTableInf; + +#define MAX_NUM_QUEUE_ELEM 1024 +typedef struct _THDPRINTED { + size_t cur_index; + char is_thd_printed_queue [MAX_NUM_QUEUE_ELEM]; +} THDPRINTED; + +#define MAX_COMMAND_CHAR_NUMBERS 40 +const char *retrieve_command(THD *thd, bool & is_sql_cmd); +typedef size_t OFFSET; + +#define MAX_COM_STATUS_VARS_RECORDS 512 + +// mysql max identifier is 64 so 2*64 + . and null +#define MAX_OBJECT_CHAR_NUMBERS 131 +#define MAX_USER_CHAR_NUMBERS 20 +#define MAX_NUM_OBJECT_ELEM 256 +#define MAX_NUM_USER_ELEM 256 + +/** + * The struct used to hold offsets. We should have one per version. + */ +typedef struct ThdOffsets { + const char *version; + const char *md5digest; + OFFSET query_id; + OFFSET thread_id; + OFFSET main_security_ctx; + OFFSET command; + OFFSET lex; + OFFSET lex_comment; + OFFSET sec_ctx_user; + OFFSET sec_ctx_host; + OFFSET sec_ctx_ip; + OFFSET sec_ctx_priv_user; + OFFSET db; + OFFSET killed; +} ThdOffsets; + +/* + * The offsets array + */ +extern const ThdOffsets thd_offsets_arr[]; +extern const size_t thd_offsets_arr_size; + +/* + * On success, the number of bytes written are returned (zero indicates nothing was written). On error, -1 is returned, + */ +typedef ssize_t (*audit_write_func)(const char *, size_t); + + +/** + * Interface for an io writer + */ +class IWriter { +public: + virtual ~IWriter() {} + // return negative on fail + virtual ssize_t write(const char *data, size_t size) = 0; + inline ssize_t write_str(const char *str) + { + return write(str, strlen(str)); + } + // return 0 on success + virtual int open(const char *io_dest, bool log_errors) = 0; + virtual void close() = 0; +}; + +class ThdSesData { +public: + // enum indicating from where the object list came from + enum ObjectIterType {OBJ_NONE, OBJ_DB, OBJ_QUERY_CACHE, OBJ_TABLE_LIST}; + ThdSesData(THD *pTHD); + THD *getTHD() { return m_pThd;} + const char *getCmdName() { return m_CmdName; } + const char *getUserName() { return m_UserName; } + /** + * Start fetching objects. Return true if there are objects available. + */ + bool startGetObjects(); + /** + * Get next object. Return true if populated. False if there isn't an object available. + * Will point the passed pointers to point to db, name and type. + * obj_type is optional and may be null. + */ + bool getNextObject(const char **db_name, const char **obj_name, const char **obj_type); + +private: + THD *m_pThd; + const char *m_CmdName; + const char *m_UserName; + bool m_isSqlCmd; + enum ObjectIterType m_objIterType; + // pointer for iterating tables + TABLE_LIST *m_tables; + // indicator if we are at the first table + bool m_firstTable; + // used for query cache iter + QueryTableInf *m_tableInf; + int m_index; + +protected: + ThdSesData(const ThdSesData&); + ThdSesData &operator =(const ThdSesData&); +}; + +/** + * Base for audit formatter + */ +class Audit_formatter { +public: + virtual ~Audit_formatter() {} + + /** + * static offsets to use for fetching THD data. Set by the audit plugin during startup. + */ + static ThdOffsets thd_offsets; + + /** + * Format an audit event from the passed THD. Will write out its output using the audit_write_func. + * + * @return -1 on a failure + */ + virtual ssize_t event_format(ThdSesData *pThdData, IWriter *writer) =0; + /** + * format a message when handler is started + * @return -1 on a failure + */ + virtual ssize_t start_msg_format(IWriter *writer) { return 0; } + /** + * format a message when handler is stopped + * @return -1 on a failure + */ + virtual ssize_t stop_msg_format(IWriter *writer) { return 0; } + + static const char *retrieve_object_type(TABLE_LIST *pObj); + static QueryTableInf *getQueryCacheTableList1(THD *thd); + // utility functions for fetching thd stuff + static inline my_thread_id thd_inst_thread_id(THD *thd) + { + return *(my_thread_id *) (((unsigned char *) thd) + + Audit_formatter::thd_offsets.thread_id); + } + static inline query_id_t thd_inst_query_id(THD *thd) + { + return *(query_id_t *) (((unsigned char *) thd) + + Audit_formatter::thd_offsets.query_id); + } + static inline Security_context *thd_inst_main_security_ctx(THD *thd) + { + return (Security_context *) (((unsigned char *) thd) + + Audit_formatter::thd_offsets.main_security_ctx); + } + + static inline const char *thd_db(THD *thd) + { + if (! Audit_formatter::thd_offsets.db) // no offsets use compiled in header + { +#if defined(MARIADB_BASE_VERSION) || MYSQL_VERSION_ID < 50709 + return thd->db; +#else + return thd->db().str; +#endif + } + return *(const char **) (((unsigned char *) thd) + + Audit_formatter::thd_offsets.db); + } + + static inline int thd_killed(THD *thd) + { + if (! Audit_formatter::thd_offsets.killed) // no offsets use thd_killed function + { + return ::thd_killed(thd); + } + return *(int *) (((unsigned char *) thd) + + Audit_formatter::thd_offsets.killed); + } + + static inline const char *thd_inst_main_security_ctx_user(THD *thd) + { + Security_context *sctx = thd_inst_main_security_ctx(thd); + if (! Audit_formatter::thd_offsets.sec_ctx_user) // no offsets use compiled in header + { +#if defined(MARIADB_BASE_VERSION) || MYSQL_VERSION_ID < 50709 + return sctx->user; +#else + return sctx->user().str; +#endif + } + return *(const char **) (((unsigned char *) sctx) + + Audit_formatter::thd_offsets.sec_ctx_user); + } + + static inline const char *thd_inst_main_security_ctx_host(THD *thd) + { + Security_context *sctx = thd_inst_main_security_ctx(thd); + if (! Audit_formatter::thd_offsets.sec_ctx_ip) // check ip to understand if set as host is first and may actually be set to 0 + { + // interface changed in 5.5.34 and 5.6.14 and up host changed to get_host() + // see: http://bazaar.launchpad.net/~mysql/mysql-server/5.5/revision/4407.1.1/sql/sql_class.h +#if defined(MARIADB_BASE_VERSION) + return sctx->host; +#else + // MySQL +#if MYSQL_VERSION_ID < 50534 || (MYSQL_VERSION_ID >= 50600 && MYSQL_VERSION_ID < 50614) + return sctx->host; +#elif (MYSQL_VERSION_ID >= 50534 && MYSQL_VERSION_ID < 50600) \ + || (MYSQL_VERSION_ID >= 50614 && MYSQL_VERSION_ID < 50709) + return sctx->get_host()->ptr(); +#else + // interface changed again in 5.7 + return sctx->host().str; +#endif +#endif // ! defined(MARIADB_BASE_VERSION) + } + return *(const char **) (((unsigned char *) sctx) + + Audit_formatter::thd_offsets.sec_ctx_host); + } + + static inline const char *thd_inst_main_security_ctx_ip(THD *thd) + { + Security_context *sctx = thd_inst_main_security_ctx(thd); + if (! Audit_formatter::thd_offsets.sec_ctx_ip) // no offsets use compiled in header + { + // interface changed in 5.5.34 and 5.6.14 and up host changed to get_ip() +#if defined(MARIADB_BASE_VERSION) + return sctx->ip; +#else + // MySQL +#if MYSQL_VERSION_ID < 50534 || (MYSQL_VERSION_ID >= 50600 && MYSQL_VERSION_ID < 50614) + return sctx->ip; +#elif (MYSQL_VERSION_ID >= 50534 && MYSQL_VERSION_ID < 50600) \ + || (MYSQL_VERSION_ID >= 50614 && MYSQL_VERSION_ID < 50709) + return sctx->get_ip()->ptr(); +#else + // interface changed again in 5.7 + return sctx->ip().str; +#endif +#endif // ! defined(MARIADB_BASE_VERSION) + } + return *(const char **) (((unsigned char *) sctx) + + Audit_formatter::thd_offsets.sec_ctx_ip); + } + + static inline const char *thd_inst_main_security_ctx_priv_user(THD *thd) + { + Security_context *sctx = thd_inst_main_security_ctx(thd); + if (! Audit_formatter::thd_offsets.sec_ctx_priv_user) // no offsets use compiled in header + { +#if defined(MARIADB_BASE_VERSION) || MYSQL_VERSION_ID < 50709 + return sctx->priv_user; +#else + return sctx->priv_user().str; +#endif + } +#if MYSQL_VERSION_ID < 50505 + // in 5.1.x priv_user is a pointer + return *(const char **) (((unsigned char *) sctx) + + Audit_formatter::thd_offsets.sec_ctx_priv_user); +#else + // in 5.5 and up priv_user is an array (char priv_user[USERNAME_LENGTH]) + return (const char *) (((unsigned char *) sctx) + + Audit_formatter::thd_offsets.sec_ctx_priv_user); +#endif + } + + static inline int thd_inst_command(THD *thd) + { + return *(int *) (((unsigned char *) thd) + Audit_formatter::thd_offsets.command); + } + + static inline LEX *thd_lex(THD *thd) + { + return *(LEX **) (((unsigned char *) thd) + Audit_formatter::thd_offsets.lex); + } + + // we don't use get_db_name() as when we call it view may be not null and it may return an invalid value for view_db + static inline const char *table_get_db_name(TABLE_LIST *table) + { + return table->db; + } + + static inline const char *table_get_name(TABLE_LIST *table) + { + return table->table_name; + } + + static inline bool table_is_view(TABLE_LIST *table) + { + return table->view_tables != 0; + } +}; + + +/** + * Format the audit even in json format + */ +class Audit_json_formatter: public Audit_formatter { +public: + static const char *DEF_MSG_DELIMITER; + + Audit_json_formatter(): m_msg_delimiter(NULL), m_write_start_msg(true), m_password_mask_regex_preg(NULL), + m_password_mask_regex_compiled(false), m_perform_password_masking(NULL) + { + config.beautify = 0; + config.indentString = NULL; + } + + virtual ~Audit_json_formatter() + { + if (m_password_mask_regex_preg) + { + m_password_mask_regex_compiled = false; + pcre_free(m_password_mask_regex_preg); + m_password_mask_regex_preg = NULL; + } + } + + virtual ssize_t event_format(ThdSesData *pThdData, IWriter *writer); + virtual ssize_t start_msg_format(IWriter *writer); + + /** + * Utility method used to compile a regex program. Will compile and log errors if necessary. + * Return null if fails + */ + static pcre *regex_compile(const char *str); + + /** + * Compile password masking regex + * Return true on success + */ + bool compile_password_masking_regex(const char *str); + + /** + * Boolean indicating if to log start msg. + * Public so sysvar can update. + */ + my_bool m_write_start_msg; + + + /** + * Callback function to determine if password masking should be performed + */ + my_bool (*m_perform_password_masking)(const char *cmd); + + /** + * Message delimiter. Should point to a valid json string (supporting the json escapping format). + * Will only be checked at the start. Public so can be set by sysvar. + * + * We only support a delimiter up to 32 chars + */ + char *m_msg_delimiter; + + /** + * Configuration of yajl. Leave public so sysvar can update this directly. + */ + yajl_gen_config config; + +protected: + + Audit_json_formatter& operator =(const Audit_json_formatter& b); + Audit_json_formatter(const Audit_json_formatter& ); + + /** + * Boolean indicating if password masking regex is compiled + */ + my_bool m_password_mask_regex_compiled; + + /** + * Regex used for password masking + */ + pcre *m_password_mask_regex_preg; +}; + +/** + * Base class for audit handlers. Provides basic locking setup. + */ +class Audit_handler { +public: + static const size_t MAX_AUDIT_HANDLERS_NUM = 4; + static const size_t JSON_FILE_HANDLER = 1; + static const size_t JSON_SOCKET_HANDLER = 3; + + static Audit_handler *m_audit_handler_list[]; + + /** + * Will iterate the handler list and log using each handler + */ + static void log_audit_all(ThdSesData *pThdData); + + /** + * Will iterate the handler list and stop all handlers + */ + static void stop_all(); + + Audit_handler() : + m_initialized(false), m_enabled(false), m_print_offset_err(true), + m_formatter(NULL), m_failed(false), m_log_io_errors(true) + { + } + + virtual ~Audit_handler() + { + if (m_initialized) + { + rwlock_destroy(&LOCK_audit); + pthread_mutex_destroy(&LOCK_io); + } + } + + /** + * Should be called to initialize. We don't init in constructor in order to provide indication if + * pthread stuff failed init. + * + * @frmt the formatter to use in this handler (does not manage distruction of this object) + * @return 0 on success + */ + int init(Audit_formatter *frmt) + { + m_formatter = frmt; + if (m_initialized) + { + return 0; + } + int res = my_rwlock_init(&LOCK_audit, NULL); + if (res) + { + return res; + } + res = pthread_mutex_init(&LOCK_io, MY_MUTEX_INIT_SLOW);; + if (res) + { + return res; + } + m_initialized = true; + return res; + } + + bool is_init() + { + return m_initialized; + } + + void set_enable(bool val); + + bool is_enabled() + { + return m_enabled; + } + + /** + * will close and start the handler + */ + void flush(); + + /** + * Will get relevant shared lock and call internal method of handler + */ + void log_audit(ThdSesData *pThdData); + + /** + * Public so can be configured via sysvar + */ + unsigned int m_retry_interval; + +protected: + Audit_formatter *m_formatter; + virtual void handler_start(); + // wiil call internal method and set failed as needed + bool handler_start_nolock(); + virtual void handler_stop(); + virtual bool handler_start_internal() = 0; + virtual void handler_stop_internal() = 0; + virtual bool handler_log_audit(ThdSesData *pThdData) =0; + bool m_initialized; + bool m_enabled; + bool m_failed; + bool m_log_io_errors; + time_t m_last_retry_sec_ts; + inline void set_failed() + { + time(&m_last_retry_sec_ts); + m_failed = true; + m_log_io_errors = false; + } + inline bool is_failed_now() + { + return m_failed && (m_retry_interval < 0 || + difftime(time(NULL), m_last_retry_sec_ts) > m_retry_interval); + } + // override default assignment and copy to protect against creating additional instances + Audit_handler & operator=(const Audit_handler&); + Audit_handler(const Audit_handler&); +private: + // bool indicating if to print offset errors to log or not + bool m_print_offset_err; + // lock io + pthread_mutex_t LOCK_io; + // audit (enable) lock + rw_lock_t LOCK_audit; + inline void lock_shared() + { + rw_rdlock(&LOCK_audit); + } + inline void lock_exclusive() + { + rw_wrlock(&LOCK_audit); + } + inline void unlock() + { + rw_unlock(&LOCK_audit); + } +}; + +/** + * Base class for handler which have io and need a lock + */ +class Audit_io_handler: public Audit_handler, public IWriter { +public: + Audit_io_handler() + : m_io_dest(NULL), m_io_type(NULL) + { + } + + virtual ~Audit_io_handler() + { + } + + + /** + * target we write to (socket/file). Public so we update via sysvar + */ + char *m_io_dest; + +protected: + virtual bool handler_start_internal(); + virtual void handler_stop_internal(); + // used for logging messages + const char *m_io_type; +}; + +class Audit_file_handler: public Audit_io_handler { +public: + + Audit_file_handler() : + m_sync_period(0), m_log_file(NULL), m_sync_counter(0), m_bufsize(0) + { + m_io_type = "file"; + } + + virtual ~Audit_file_handler() + { + } + + /** + * The period to use for syncing to the file system. 0 means we don't sync. + * 1 means each write we sync. Larger than 1 means every sync_period we sync. + * + * We leave this public so the mysql sysvar function can update this variable directly. + */ + unsigned int m_sync_period; + + /** + * The buf size used by the file stream. 0 = use default, negative or 1 = no buffering + */ + long m_bufsize; + + /** + * Write function we pass to formatter + */ + ssize_t write(const char *data, size_t size); + + void close(); + + int open(const char *io_dest, bool m_log_errors); + // static void print_sleep(THD *thd, int delay_ms); +protected: + // override default assignment and copy to protect against creating additional instances + Audit_file_handler & operator=(const Audit_file_handler&); + Audit_file_handler(const Audit_file_handler&); + + /** + * Will acquire locks and call handler_write + */ + virtual bool handler_log_audit(ThdSesData *pThdData); + FILE *m_log_file; + // the period to use for syncing + unsigned int m_sync_counter; +}; + +class Audit_socket_handler: public Audit_io_handler { +public: + + Audit_socket_handler() : + m_vio(NULL), m_connect_timeout(1) + { + m_io_type = "socket"; + } + + virtual ~Audit_socket_handler() + { + } + + + /** + * Connect timeout in secconds + */ + unsigned int m_connect_timeout; + + /** + * Write function we pass to formatter + */ + ssize_t write(const char *data, size_t size); + + void close(); + + int open(const char *io_dest, bool log_errors); +protected: + // override default assignment and copy to protect against creating additional instances + Audit_socket_handler & operator=(const Audit_socket_handler&); + Audit_socket_handler(const Audit_socket_handler&); + + /** + * Will acquire locks and call handler_write + */ + virtual bool handler_log_audit(ThdSesData *pThdData); + // Vio we write to + // define as void* so we don't access members directly + void *m_vio; +}; + +#endif /* AUDIT_HANDLER_H_ */ diff --git a/include/md5.h b/include/md5.h old mode 100755 new mode 100644 index 6cef285..ea367ed --- a/include/md5.h +++ b/include/md5.h @@ -43,13 +43,13 @@ extern void MD5_Init(MD5_CTX *ctx); extern void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size); extern void MD5_Final(unsigned char *result, MD5_CTX *ctx); -//define the my_MD5* functions +// define the my_MD5* functions #define my_MD5Context MD5_CTX #define my_MD5Init MD5_Init #define my_MD5Update MD5_Update #define my_MD5Final MD5_Final -#endif //#if MYSQL_VERSION_ID >= 50600 +#endif // #if MYSQL_VERSION_ID >= 50600 #endif diff --git a/include/mysql_inc.h b/include/mysql_inc.h index 89d3adc..52cc83f 100644 --- a/include/mysql_inc.h +++ b/include/mysql_inc.h @@ -8,8 +8,8 @@ #define MYSQL_DYNAMIC_PLUGIN 1 #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 +// 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 @@ -19,7 +19,7 @@ #include #else -//version 5.5.x doesn't contain mysql_priv.h . We need to add the includes provided by it. +// version 5.5.x doesn't contain mysql_priv.h . We need to add the includes provided by it. #if MYSQL_VERSION_ID >= 50505 // These two are not present in 5.7.9 @@ -43,7 +43,7 @@ #include #include -//TODO: use mysql mutex instead of pthread +// TODO: use mysql mutex instead of pthread /* #define pthread_mutex_lock mysql_mutex_lock #define pthread_mutex_unlock mysql_mutex_unlock @@ -67,8 +67,8 @@ #include #include -//5.5 use my_free with a single param. 5.1 use with 2 params -//based on: http://bazaar.launchpad.net/~mysql/myodbc/5.1/view/head:/util/stringutil.h +// 5.5 use my_free with a single param. 5.1 use with 2 params +// based on: http://bazaar.launchpad.net/~mysql/myodbc/5.1/view/head:/util/stringutil.h #ifndef x_free # if MYSQL_VERSION_ID >= 50500 # define x_free(A) { void *tmp= (A); if (tmp) my_free((char *) tmp); } @@ -77,23 +77,19 @@ # endif #endif -//MariaDB doesn't have my_getsystime (returns 100 nano seconds) function. They replaced with my_hrtime_t my_hrtime() which returns microseconds +// MariaDB doesn't have my_getsystime (returns 100 nano seconds) function. They replaced with my_hrtime_t my_hrtime() which returns microseconds #if defined(MARIADB_BASE_VERSION) #define my_getsystime() ((my_hrtime()).val * 10) -//MariaDB has a kill service that overrides thd_killed as a macro. It also has thd_killed function defined for backwards compatibility, so we redefine it. +// MariaDB has a kill service that overrides thd_killed as a macro. It also has thd_killed function defined for backwards compatibility, so we redefine it. #undef thd_killed extern "C" int thd_killed(const MYSQL_THD thd); -//MariadDB 10.0.10 removed the include for thd_security_context +// MariadDB 10.0.10 removed the include for thd_security_context #if MYSQL_VERSION_ID >= 100010 extern "C" char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length, unsigned int max_query_len); #endif #endif - - -#endif //MYSQL_INCL_H - - +#endif // MYSQL_INCL_H diff --git a/include/static_assert.h b/include/static_assert.h index e09d302..1da046a 100644 --- a/include/static_assert.h +++ b/include/static_assert.h @@ -1,43 +1,43 @@ -/* - * compile_assert.h - * - * Created on: Mar 6, 2011 - * Author: Guyl - */ - -#ifndef COMPILE_STATIC_ASSERT_H_ -#define COMPILE_STATIC_ASSERT_H_ - -/** - * Taken from: http://stackoverflow.com/questions/807244/c-compiler-asserts-how-to-implement - * A compile time assertion check. - * - * Validate at compile time that the predicate is true without - * generating code. This can be used at any point in a source file - * where typedef is legal. - * - * On success, compilation proceeds normally. - * - * On failure, attempts to typedef an array type of negative size. The - * offending line will look like - * typedef assertion_failed_file_h_42[-1] - * where file is the content of the second parameter which should - * typically be related in some obvious way to the containing file - * name, 42 is the line number in the file on which the assertion - * appears, and -1 is the result of a calculation based on the - * predicate failing. - * - * \param predicate The predicate to test. It must evaluate to - * something that can be coerced to a normal C boolean. - * - * \param file A sequence of legal identifier characters that should - * uniquely identify the source file in which this condition appears. - */ - - -#define CASSERT(predicate, file) _impl_CASSERT_LINE(predicate,__LINE__,file) -#define _impl_PASTE(a,b) a##b -#define _impl_CASSERT_LINE(predicate, line, file) \ - typedef char _impl_PASTE(assertion_failed_##file##_,line)[2*!!(predicate)-1]; - -#endif /* COMPILE_STATIC_ASSERT_H_ */ +/* + * compile_assert.h + * + * Created on: Mar 6, 2011 + * Author: Guyl + */ + +#ifndef COMPILE_STATIC_ASSERT_H_ +#define COMPILE_STATIC_ASSERT_H_ + +/** + * Taken from: http://stackoverflow.com/questions/807244/c-compiler-asserts-how-to-implement + * A compile time assertion check. + * + * Validate at compile time that the predicate is true without + * generating code. This can be used at any point in a source file + * where typedef is legal. + * + * On success, compilation proceeds normally. + * + * On failure, attempts to typedef an array type of negative size. The + * offending line will look like + * typedef assertion_failed_file_h_42[-1] + * where file is the content of the second parameter which should + * typically be related in some obvious way to the containing file + * name, 42 is the line number in the file on which the assertion + * appears, and -1 is the result of a calculation based on the + * predicate failing. + * + * \param predicate The predicate to test. It must evaluate to + * something that can be coerced to a normal C boolean. + * + * \param file A sequence of legal identifier characters that should + * uniquely identify the source file in which this condition appears. + */ + + +#define CASSERT(predicate, file) _impl_CASSERT_LINE(predicate,__LINE__,file) +#define _impl_PASTE(a,b) a##b +#define _impl_CASSERT_LINE(predicate, line, file) \ + typedef char _impl_PASTE(assertion_failed_##file##_,line)[2*!!(predicate)-1]; + +#endif /* COMPILE_STATIC_ASSERT_H_ */ diff --git a/src/audit_handler.cc b/src/audit_handler.cc index cd3709d..6f61634 100644 --- a/src/audit_handler.cc +++ b/src/audit_handler.cc @@ -18,16 +18,17 @@ * Created on: Feb 6, 2011 * Author: guyl */ + #include "audit_handler.h" -//for definition of sockaddr_un +// for definition of sockaddr_un #include #include #include "static_assert.h" -//utility macro to log also with a date as a prefix -#define log_with_date(f, ...) do{\ +// 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);\ + time_t result = time(NULL);\ localtime_r(&result, &tm_tmp);\ fprintf(f, "%02d%02d%02d %2d:%02d:%02d: ",\ tm_tmp.tm_year % 100,\ @@ -37,144 +38,142 @@ tm_tmp.tm_min,\ tm_tmp.tm_sec);\ fprintf(f, __VA_ARGS__);\ -}while(0) +} while (0) -//regex flags used in compilation +// regex flags used in compilation static const int regex_flags = PCRE_DOTALL | PCRE_UTF8 | PCRE_CASELESS | PCRE_DUPNAMES; - -//initialize static stuff +// initialize static stuff ThdOffsets Audit_formatter::thd_offsets = { 0 }; -Audit_handler * Audit_handler::m_audit_handler_list[Audit_handler::MAX_AUDIT_HANDLERS_NUM]; +Audit_handler *Audit_handler::m_audit_handler_list[Audit_handler::MAX_AUDIT_HANDLERS_NUM]; const char * Audit_json_formatter::DEF_MSG_DELIMITER = "\\n"; #if MYSQL_VERSION_ID < 50709 #define C_STRING_WITH_LEN(X) ((char *) (X)), ((size_t) (sizeof(X) - 1)) #endif - -const char * Audit_formatter::retrieve_object_type (TABLE_LIST *pObj) +const char *Audit_formatter::retrieve_object_type(TABLE_LIST *pObj) { - if (table_is_view(pObj)) + if (table_is_view(pObj)) { return "VIEW"; - } + } return "TABLE"; } - void Audit_handler::stop_all() { - for (size_t i = 0; i < MAX_AUDIT_HANDLERS_NUM; ++i) - { - if (m_audit_handler_list[i] != NULL) - { - m_audit_handler_list[i]->set_enable(false); - } - } + for (size_t 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 (size_t i = 0; i < MAX_AUDIT_HANDLERS_NUM; ++i) - { - if (m_audit_handler_list[i] != NULL) - { - m_audit_handler_list[i]->log_audit(pThdData); - } - } + for (size_t 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(); + 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(); + 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(); + 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 + 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 + // 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 in case we encounter in the future pthread_mutex_lock(&LOCK_io); - //check if failed + // check if failed bool do_log = true; if (m_failed) - { + { do_log = false; - bool retry = m_retry_interval > 0 && - difftime(time(NULL), m_last_retry_sec_ts) > m_retry_interval; - if(retry) + bool retry = m_retry_interval > 0 && + difftime(time(NULL), m_last_retry_sec_ts) > m_retry_interval; + if (retry) { do_log = handler_start_nolock(); - } + } } - if(do_log) + if (do_log) { - if(!handler_log_audit(pThdData)) + if (! handler_log_audit(pThdData)) { set_failed(); handler_stop_internal(); } } pthread_mutex_unlock(&LOCK_io); - } - unlock(); + } + unlock(); } void Audit_file_handler::close() @@ -186,25 +185,26 @@ void Audit_file_handler::close() m_log_file = NULL; } -ssize_t Audit_file_handler::write(const char * data, size_t size) +ssize_t Audit_file_handler::write(const char *data, size_t size) { - ssize_t res = my_fwrite(m_log_file, (uchar *) data, size, MYF(0)); - if(res < 0) // log the error + ssize_t res = my_fwrite(m_log_file, (uchar *) data, size, MYF(0)); + if (res < 0) // log the error { - sql_print_error("%s failed writing to file: %s. Err: %s", - AUDIT_LOG_PREFIX, m_io_dest, strerror(errno)); + sql_print_error("%s failed writing to file: %s. Err: %s", + AUDIT_LOG_PREFIX, m_io_dest, strerror(errno)); } return res; } -int Audit_file_handler::open(const char * io_dest, bool log_errors) +int Audit_file_handler::open(const char *io_dest, bool log_errors) { char format_name[FN_REFLEN]; - fn_format(format_name, io_dest, "", "", MY_UNPACK_FILENAME); - m_log_file = my_fopen(format_name, O_WRONLY | O_APPEND| O_CREAT, MYF(0)); - if (!m_log_file) - { - if(log_errors) + + fn_format(format_name, io_dest, "", "", MY_UNPACK_FILENAME); + m_log_file = my_fopen(format_name, O_WRONLY | O_APPEND| O_CREAT, MYF(0)); + if (! m_log_file) + { + if (log_errors) { sql_print_error( "%s unable to open file %s: %s. audit file handler disabled!!", @@ -212,84 +212,87 @@ int Audit_file_handler::open(const char * io_dest, bool log_errors) } return -1; } - ssize_t bufsize = BUFSIZ; - int res =0; - //0 -> use default, 1 or negative -> disabled - if(m_bufsize > 1) - { - bufsize = m_bufsize; - } - if(1 == m_bufsize || m_bufsize < 0) - { - //disabled - res = setvbuf(m_log_file, NULL, _IONBF, 0); - } - else - { - res = setvbuf(m_log_file, NULL, _IOFBF, bufsize); - - } - if(res) - { - sql_print_error( - "%s unable to set bufzie [%zd (%ld)] for file %s: %s.", - AUDIT_LOG_PREFIX, bufsize, m_bufsize, m_io_dest, strerror(errno)); - } - sql_print_information("%s bufsize for file [%s]: %zd. Value of json_file_bufsize: %ld.", AUDIT_LOG_PREFIX, m_io_dest, - __fbufsize(m_log_file), m_bufsize); + + ssize_t bufsize = BUFSIZ; + int res = 0; + // 0 -> use default, 1 or negative -> disabled + if (m_bufsize > 1) + { + bufsize = m_bufsize; + } + + if (1 == m_bufsize || m_bufsize < 0) + { + // disabled + res = setvbuf(m_log_file, NULL, _IONBF, 0); + } + else + { + res = setvbuf(m_log_file, NULL, _IOFBF, bufsize); + + } + + if (res) + { + sql_print_error( + "%s unable to set bufzie [%zd (%ld)] for file %s: %s.", + AUDIT_LOG_PREFIX, bufsize, m_bufsize, m_io_dest, strerror(errno)); + } + sql_print_information("%s bufsize for file [%s]: %zd. Value of json_file_bufsize: %ld.", AUDIT_LOG_PREFIX, m_io_dest, + __fbufsize(m_log_file), m_bufsize); return 0; } -//no locks. called by handler_start and when it is time to retry +// no locks. called by handler_start and when it is time to retry bool Audit_io_handler::handler_start_internal() { - if(!m_io_dest || strlen(m_io_dest) == 0) + if (! m_io_dest || strlen(m_io_dest) == 0) { - if(m_log_io_errors) + if (m_log_io_errors) { sql_print_error( "%s %s: io destination not set. Not connecting.", AUDIT_LOG_PREFIX, m_io_type); } - return false; + return false; } if (open(m_io_dest, m_log_io_errors) != 0) - { - //open failed + { + // open failed return false; - } - ssize_t res = m_formatter->start_msg_format(this); + } + 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. + * Sanity check of writing to the log. If we fail, we print an erorr and disable this handler. */ if (res < 0) { - if(m_log_io_errors) + if (m_log_io_errors) { sql_print_error( "%s unable to write header msg to %s: %s.", AUDIT_LOG_PREFIX, m_io_dest, strerror(errno)); } - close(); + close(); return false; } sql_print_information("%s success opening %s: %s.", AUDIT_LOG_PREFIX, m_io_type, m_io_dest); - return true; + return true; } void Audit_io_handler::handler_stop_internal() { - if(!m_failed) + if (! m_failed) { m_formatter->stop_msg_format(this); } - close(); + close(); } bool Audit_handler::handler_start_nolock() { bool res = handler_start_internal(); - if(res) + if (res) { m_failed = false; } @@ -302,34 +305,35 @@ bool Audit_handler::handler_start_nolock() void Audit_handler::handler_start() { - pthread_mutex_lock(&LOCK_io); + pthread_mutex_lock(&LOCK_io); m_log_io_errors = true; - handler_start_nolock(); - pthread_mutex_unlock(&LOCK_io); + handler_start_nolock(); + pthread_mutex_unlock(&LOCK_io); } + void Audit_handler::handler_stop() { - pthread_mutex_lock(&LOCK_io); - handler_stop_internal(); - pthread_mutex_unlock(&LOCK_io); + pthread_mutex_lock(&LOCK_io); + handler_stop_internal(); + pthread_mutex_unlock(&LOCK_io); } bool Audit_file_handler::handler_log_audit(ThdSesData *pThdData) { - bool res = (m_formatter->event_format(pThdData, this) >= 0); - if (res && m_sync_period && ++m_sync_counter >= 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). + bool res = (m_formatter->event_format(pThdData, this) >= 0); + if (res && m_sync_period && ++m_sync_counter >= 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). res = (fflush(m_log_file) == 0); - if(res) + if (res) { int fd = fileno(m_log_file); res = (my_sync(fd, MYF(MY_WME)) == 0); } - } + } return res; } @@ -339,57 +343,57 @@ void Audit_socket_handler::close() { if (m_vio) { - //no need for vio_close as is called by delete (additionally close changed its name to vio_shutdown in 5.6.11) + // no need for vio_close as is called by delete (additionally close changed its name to vio_shutdown in 5.6.11) vio_delete((Vio*)m_vio); } m_vio = NULL; } -ssize_t Audit_socket_handler::write(const char * data, size_t size) +ssize_t Audit_socket_handler::write(const char *data, size_t size) { - ssize_t res = vio_write((Vio*)m_vio, (const uchar *) data, size); - if(res < 0) // log the error + ssize_t res = vio_write((Vio*)m_vio, (const uchar *) data, size); + if (res < 0) // log the error { - sql_print_error("%s failed writing to socket: %s. Err: %s", - AUDIT_LOG_PREFIX, m_io_dest, strerror(vio_errno((Vio*)m_vio))); + sql_print_error("%s failed writing to socket: %s. Err: %s", + AUDIT_LOG_PREFIX, m_io_dest, strerror(vio_errno((Vio*)m_vio))); } return res; } -int Audit_socket_handler::open(const char * io_dest, bool log_errors) -{ - //open the socket - int sock = socket(AF_UNIX,SOCK_STREAM,0); - if (sock < 0) - { - if(log_errors) +int Audit_socket_handler::open(const char *io_dest, bool log_errors) +{ + // open the socket + int sock = socket(AF_UNIX, SOCK_STREAM, 0); + if (sock < 0) + { + if (log_errors) { sql_print_error( "%s unable to create unix socket: %s.", AUDIT_LOG_PREFIX, strerror(errno)); } - return -1; - } + return -1; + } - //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, io_dest, sizeof(UNIXaddr.sun_path)-1); + // 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, io_dest, sizeof(UNIXaddr.sun_path)-1); #if MYSQL_VERSION_ID < 50600 - if (my_connect(sock,(struct sockaddr *) &UNIXaddr, sizeof(UNIXaddr), - m_connect_timeout)) + if (my_connect(sock,(struct sockaddr *) &UNIXaddr, sizeof(UNIXaddr), + m_connect_timeout)) #else - //in 5.6 timeout is in ms - if (vio_socket_connect((Vio*)m_vio,(struct sockaddr *) &UNIXaddr, sizeof(UNIXaddr), - m_connect_timeout * 1000)) + // in 5.6 timeout is in ms + if (vio_socket_connect((Vio*)m_vio,(struct sockaddr *) &UNIXaddr, sizeof(UNIXaddr), + m_connect_timeout * 1000)) #endif - { - if(log_errors) + { + if (log_errors) { sql_print_error( - "%s unable to connect to socket: %s. err: %s.", - AUDIT_LOG_PREFIX, m_io_dest, strerror(errno)); + "%s unable to connect to socket: %s. err: %s.", + AUDIT_LOG_PREFIX, m_io_dest, strerror(errno)); } close(); return -2; @@ -398,90 +402,89 @@ int Audit_socket_handler::open(const char * io_dest, bool log_errors) } bool Audit_socket_handler::handler_log_audit(ThdSesData *pThdData) -{ - return (m_formatter->event_format(pThdData, this) >= 0); +{ + return (m_formatter->event_format(pThdData, this) >= 0); } //////////////////////// Audit Socket handler end /////////////////////////////////////////// - -static yajl_gen_status yajl_add_string(yajl_gen hand, const char * str) +static yajl_gen_status yajl_add_string(yajl_gen hand, const char *str) { - return yajl_gen_string(hand, (const unsigned char*)str, strlen(str)); + return yajl_gen_string(hand, (const unsigned char *) str, strlen(str)); } -static void yajl_add_string_val(yajl_gen hand, const char * name, const char* val) +static void yajl_add_string_val(yajl_gen hand, const char *name, const char *val) { - if(0 == val) + if (0 == val) { - return; //we don't add NULL values to json + return; // we don't add NULL values to json } - yajl_add_string(hand, name); - yajl_add_string(hand, val); + yajl_add_string(hand, name); + yajl_add_string(hand, val); } -static void yajl_add_string_val(yajl_gen hand, const char * name, const char* val, size_t val_len) +static 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); + yajl_add_string(hand, name); + yajl_gen_string(hand, (const unsigned char*)val, val_len); } -static void yajl_add_uint64(yajl_gen gen, const char * name, uint64 num) +static 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 void yajl_add_obj( yajl_gen gen, const char *db,const char* ptype,const char * name =NULL) -{ - if(db) - { - yajl_add_string_val(gen, "db", db); - } - if (name) - { - yajl_add_string_val(gen, "name", name); - } - yajl_add_string_val(gen, "obj_type",ptype); + 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 const char * retrieve_user (THD * thd) +static void yajl_add_obj(yajl_gen gen, const char *db, const char *ptype, const char *name = NULL) { - - const char * user = Audit_formatter::thd_inst_main_security_ctx_user(thd); - if(user != NULL && *user != 0x0) //non empty + if (db) { - return user; - } - user = Audit_formatter::thd_inst_main_security_ctx_priv_user(thd); //try using priv user - if(user != NULL && *user != 0x0) //non empty + yajl_add_string_val(gen, "db", db); + } + if (name) + { + yajl_add_string_val(gen, "name", name); + } + yajl_add_string_val(gen, "obj_type", ptype); +} + +static const char *retrieve_user(THD *thd) +{ + const char *user = Audit_formatter::thd_inst_main_security_ctx_user(thd); + if (user != NULL && *user != '\0') // non empty { return user; } - return ""; //always use at least the empty string + user = Audit_formatter::thd_inst_main_security_ctx_priv_user(thd); // try using priv user + if (user != NULL && *user != '\0') // non empty + { + return user; + } + return ""; // always use at least the empty string } -//will return a pointer to the query and set len with the length of the query -//starting with MySQL version 5.1.41 thd_query_string is added -//And at 5.7 it changed +// will return a pointer to the query and set len with the length of the query +// starting with MySQL version 5.1.41 thd_query_string is added +// And at 5.7 it changed #if ! defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50709 extern "C" LEX_CSTRING thd_query_unsafe(MYSQL_THD thd); -static const char * thd_query_str(THD * thd, size_t * len) +static const char *thd_query_str(THD *thd, size_t *len) { - const LEX_CSTRING str = thd_query_unsafe(thd); - if(str.length > 0) - { - *len = str.length; - return str.str; - } - *len = 0; - return NULL; + const LEX_CSTRING str = thd_query_unsafe(thd); + if (str.length > 0) + { + *len = str.length; + return str.str; + } + *len = 0; + return NULL; } #elif defined(MARIADB_BASE_VERSION) || MYSQL_VERSION_ID > 50140 @@ -489,83 +492,86 @@ static const char * thd_query_str(THD * thd, size_t * len) extern "C" { MYSQL_LEX_STRING *thd_query_string(MYSQL_THD thd); } -static const char * thd_query_str(THD * thd, size_t * len) + +static const char *thd_query_str(THD *thd, size_t *len) { - MYSQL_LEX_STRING * str = thd_query_string(thd); - if(str) - { - *len = str->length; - return str->str; - } - *len = 0; - return NULL; + MYSQL_LEX_STRING * str = thd_query_string(thd); + if (str) + { + *len = str->length; + return str->str; + } + *len = 0; + return NULL; } #else -//we are being compiled against mysql version 5.1.40 or lower (our default compilation env) -//we still want to support thd_query_string if we are run on a version higher than 5.1.40, so we try to lookup the symbol +// we are being compiled against mysql version 5.1.40 or lower (our default compilation env) +// we still want to support thd_query_string if we are run on a version higher than 5.1.40, so we try to lookup the symbol static LEX_STRING * (*thd_query_string_func)(THD *thd) = (LEX_STRING*(*)(THD*))dlsym(RTLD_DEFAULT, "thd_query_string"); -static bool print_thd_query_string_func = true; //debug info print only once -static const char * thd_query_str(THD * thd, size_t * len) +static bool print_thd_query_string_func = true; // debug info print only once + +static const char *thd_query_str(THD *thd, size_t *len) { - if(print_thd_query_string_func) - { - sql_print_information("%s thd_query_string_func: 0x%lx", AUDIT_LOG_PREFIX, (unsigned long)thd_query_string_func); - print_thd_query_string_func = false; - } - if(thd_query_string_func) - { - MYSQL_LEX_STRING * str = thd_query_string_func(thd); - if(str) - { - *len = str->length; - return str->str; - } - *len = 0; - return NULL; - } - *len = thd->query_length; - return thd->query; + if (print_thd_query_string_func) + { + sql_print_information("%s thd_query_string_func: 0x%lx", AUDIT_LOG_PREFIX, (unsigned long)thd_query_string_func); + print_thd_query_string_func = false; + } + if (thd_query_string_func) + { + MYSQL_LEX_STRING *str = thd_query_string_func(thd); + if (str) + { + *len = str->length; + return str->str; + } + *len = 0; + return NULL; + } + *len = thd->query_length; + return thd->query; } #endif -ssize_t Audit_json_formatter::start_msg_format(IWriter * writer) +ssize_t Audit_json_formatter::start_msg_format(IWriter *writer) { - if(!m_write_start_msg) //disabled - { - return 0; - } - //initialize yajl - yajl_gen gen = yajl_gen_alloc(&config, NULL); - yajl_gen_map_open(gen); - yajl_add_string_val(gen, "msg-type", "header"); + if (! m_write_start_msg) // disabled + { + return 0; + } + + // initialize yajl + yajl_gen gen = yajl_gen_alloc(&config, NULL); + yajl_gen_map_open(gen); + yajl_add_string_val(gen, "msg-type", "header"); uint64 ts = my_getsystime() / (10000); yajl_add_uint64(gen, "date", ts); yajl_add_string_val(gen, "audit-version", MYSQL_AUDIT_PLUGIN_VERSION"-"MYSQL_AUDIT_PLUGIN_REVISION); - yajl_add_string_val(gen, "audit-protocol-version", AUDIT_PROTOCOL_VERSION); + yajl_add_string_val(gen, "audit-protocol-version", AUDIT_PROTOCOL_VERSION); yajl_add_string_val(gen, "hostname", glob_hostname); - yajl_add_string_val(gen, "mysql-version", server_version); - yajl_add_string_val(gen, "mysql-program", my_progname); - yajl_add_string_val(gen, "mysql-socket", mysqld_unix_port); - yajl_add_uint64(gen, "mysql-port", mysqld_port); + yajl_add_string_val(gen, "mysql-version", server_version); + yajl_add_string_val(gen, "mysql-program", my_progname); + yajl_add_string_val(gen, "mysql-socket", mysqld_unix_port); + yajl_add_uint64(gen, "mysql-port", mysqld_port); 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; - + + 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; } // This routine replaces clear text with the string in `replace', leaving the rest of the string intact. @@ -602,54 +608,55 @@ static const char *replace_in_string(THD *thd, return new_str; } -ssize_t Audit_json_formatter::event_format(ThdSesData* pThdData, IWriter * writer) +ssize_t Audit_json_formatter::event_format(ThdSesData *pThdData, IWriter *writer) { - THD * thd = pThdData->getTHD(); - unsigned long thdid = thd_get_thread_id(thd); - query_id_t qid = thd_inst_query_id(thd); + THD *thd = pThdData->getTHD(); + unsigned long thdid = thd_get_thread_id(thd); + query_id_t qid = thd_inst_query_id(thd); - //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); + // 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", pThdData->getUserName()); yajl_add_string_val(gen, "priv_user", Audit_formatter::thd_inst_main_security_ctx_priv_user(thd)); yajl_add_string_val(gen, "host", Audit_formatter::thd_inst_main_security_ctx_host(thd)); - yajl_add_string_val(gen, "ip", Audit_formatter::thd_inst_main_security_ctx_ip(thd)); - const char *cmd = pThdData->getCmdName(); - yajl_add_string_val(gen, "cmd", cmd); - //get objects - if(pThdData->startGetObjects()) - { - yajl_add_string(gen, "objects"); - yajl_gen_array_open(gen); - const char * db_name = NULL; - const char * obj_name = NULL; - const char * obj_type = NULL; - while(pThdData->getNextObject(&db_name, &obj_name, &obj_type)) - { - yajl_gen_map_open(gen); - yajl_add_obj (gen, db_name, obj_type, obj_name ); - yajl_gen_map_close(gen); - } - yajl_gen_array_close(gen); - } + yajl_add_string_val(gen, "ip", Audit_formatter::thd_inst_main_security_ctx_ip(thd)); + const char *cmd = pThdData->getCmdName(); + yajl_add_string_val(gen, "cmd", cmd); - size_t qlen = 0; - const char * query = thd_query_str(pThdData->getTHD(), &qlen); - if (query && qlen > 0) - { + // get objects + if (pThdData->startGetObjects()) + { + yajl_add_string(gen, "objects"); + yajl_gen_array_open(gen); + const char *db_name = NULL; + const char *obj_name = NULL; + const char *obj_type = NULL; + while (pThdData->getNextObject(&db_name, &obj_name, &obj_type)) + { + yajl_gen_map_open(gen); + yajl_add_obj (gen, db_name, obj_type, obj_name ); + yajl_gen_map_close(gen); + } + yajl_gen_array_close(gen); + } + + size_t qlen = 0; + const char *query = thd_query_str(pThdData->getTHD(), &qlen); + if (query && qlen > 0) + { #if MYSQL_VERSION_ID < 50600 - CHARSET_INFO *col_connection; + CHARSET_INFO *col_connection; #else - const CHARSET_INFO *col_connection; + const CHARSET_INFO *col_connection; #endif col_connection = Item::default_charset(); @@ -658,7 +665,8 @@ ssize_t Audit_json_formatter::event_format(ThdSesData* pThdData, IWriter * write const char *query_text = query; size_t query_len = qlen; - if (strcmp(col_connection->csname, "utf8") != 0) { + if (strcmp(col_connection->csname, "utf8") != 0) + { // max UTF-8 bytes per char is 4. size_t to_amount = (qlen * 4) + 1; char* to = (char *) thd_alloc(thd, to_amount); @@ -666,9 +674,9 @@ ssize_t Audit_json_formatter::event_format(ThdSesData* pThdData, IWriter * write uint errors = 0; size_t len = copy_and_convert(to, to_amount, - &my_charset_utf8_general_ci, - query, qlen, - col_connection, & errors); + &my_charset_utf8_general_ci, + query, qlen, + col_connection, & errors); to[len] = '\0'; @@ -676,20 +684,23 @@ ssize_t Audit_json_formatter::event_format(ThdSesData* pThdData, IWriter * write qlen = len; } - if(m_perform_password_masking && m_password_mask_regex_compiled && m_password_mask_regex_preg && m_perform_password_masking(cmd)) + if (m_perform_password_masking + && m_password_mask_regex_compiled + && m_password_mask_regex_preg + && m_perform_password_masking(cmd)) { - //do password masking - int matches[90] = {0}; - if(pcre_exec(m_password_mask_regex_preg, NULL, query_text, query_len, 0, 0, matches, array_elements(matches)) >= 0) + // do password masking + int matches[90] = { 0 }; + if (pcre_exec(m_password_mask_regex_preg, NULL, query_text, query_len, 0, 0, matches, array_elements(matches)) >= 0) { - //search for the first substring that matches with the name psw + // search for the first substring that matches with the name psw char *first = NULL, *last = NULL; int entrysize = pcre_get_stringtable_entries(m_password_mask_regex_preg, "psw", &first, &last); - if(entrysize > 0) + if (entrysize > 0) { - for (unsigned char * entry = (unsigned char *)first; entry <= (unsigned char *)last; entry += entrysize) + for (unsigned char *entry = (unsigned char *)first; entry <= (unsigned char *)last; entry += entrysize) { - //first 2 bytes give us the number + // first 2 bytes give us the number int n = (((int)(entry)[0]) << 8) | (entry)[1]; if (n > 0 && n < (int)array_elements(matches) && matches[n*2] >= 0) { @@ -700,198 +711,203 @@ ssize_t Audit_json_formatter::event_format(ThdSesData* pThdData, IWriter * write // interfaces in MySQL have changed fairly drastically. So we just do the // replacement ourselves. const char *pass_replace = "***"; - const char *updated = replace_in_string(thd, query_text, query_len, matches[n*2], matches[(n*2) + 1] - matches[n*2], pass_replace); + const char *updated = replace_in_string(thd, + query_text, + query_len, + matches[n*2], + matches[(n*2) + 1] - matches[n*2], + pass_replace); query_text = updated; query_len = strlen(query_text); break; } } - } + } } } yajl_add_string_val(gen, "query", query_text, query_len); - } - 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; + } + 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_UserName(NULL), +ThdSesData::ThdSesData(THD *pTHD) + : m_pThd (pTHD), m_CmdName(NULL), m_UserName(NULL), m_objIterType(OBJ_NONE), m_tables(NULL), m_firstTable(true), m_tableInf(NULL), m_index(0), m_isSqlCmd(false) { - m_CmdName = retrieve_command (m_pThd, m_isSqlCmd); - m_UserName = retrieve_user (m_pThd); + m_CmdName = retrieve_command (m_pThd, m_isSqlCmd); + m_UserName = retrieve_user (m_pThd); } bool ThdSesData::startGetObjects() { - //reset vars as this may be called multiple times - m_objIterType = OBJ_NONE; - m_tables = NULL; - m_firstTable = true; - m_index = 0; - m_tableInf = Audit_formatter::getQueryCacheTableList1(getTHD()); - int command = Audit_formatter::thd_inst_command(getTHD()); - LEX * pLex = Audit_formatter::thd_lex(getTHD()); - //query cache case - if(pLex && command == COM_QUERY && m_tableInf && m_tableInf->num_of_elem > 0) - { - m_objIterType = OBJ_QUERY_CACHE; - return true; - } - const char *cmd = getCmdName(); - //commands which have single database object - if (strcmp (cmd,"Init DB") ==0 - || strcmp (cmd, "SHOW TABLES")== 0 - || strcmp (cmd, "SHOW TABLE")==0) - { - if(Audit_formatter::thd_db(getTHD())) - { - m_objIterType = OBJ_DB; - return true; - } - return false; - } - //only return query tabls if command is COM_QUERY - //TODO: check if other commands can also generate query tables such as "show fields" - if (pLex && command == COM_QUERY && pLex->query_tables) - { - m_tables = pLex->query_tables; - m_objIterType = OBJ_TABLE_LIST; - return true; - } - //no objects - return false; + // reset vars as this may be called multiple times + m_objIterType = OBJ_NONE; + m_tables = NULL; + m_firstTable = true; + m_index = 0; + m_tableInf = Audit_formatter::getQueryCacheTableList1(getTHD()); + int command = Audit_formatter::thd_inst_command(getTHD()); + LEX *pLex = Audit_formatter::thd_lex(getTHD()); + // query cache case + if (pLex && command == COM_QUERY && m_tableInf && m_tableInf->num_of_elem > 0) + { + m_objIterType = OBJ_QUERY_CACHE; + return true; + } + const char *cmd = getCmdName(); + // commands which have single database object + if (strcmp(cmd,"Init DB") == 0 + || strcmp(cmd, "SHOW TABLES") == 0 + || strcmp(cmd, "SHOW TABLE") == 0) + { + if (Audit_formatter::thd_db(getTHD())) + { + m_objIterType = OBJ_DB; + return true; + } + return false; + } + // only return query tables if command is COM_QUERY + // TODO: check if other commands can also generate query tables such as "show fields" + if (pLex && command == COM_QUERY && pLex->query_tables) + { + m_tables = pLex->query_tables; + m_objIterType = OBJ_TABLE_LIST; + return true; + } + // no objects + return false; } -bool ThdSesData::getNextObject(const char ** db_name, const char ** obj_name, const char ** obj_type) +bool ThdSesData::getNextObject(const char **db_name, const char **obj_name, const char **obj_type) { - switch(m_objIterType) - { - case OBJ_DB: - { - if(m_firstTable) - { - *db_name = Audit_formatter::thd_db(getTHD()); - *obj_name = NULL; - if(obj_type) - { - *obj_type = "DATABASE"; - } - m_firstTable = false; - return true; - } - return false; - } - case OBJ_QUERY_CACHE: - { - if(m_index < m_tableInf->num_of_elem && - m_index< MAX_NUM_QUERY_TABLE_ELEM) - { - *db_name = m_tableInf->db[m_index]; - *obj_name = m_tableInf->table_name[m_index]; - if(obj_type) - { - *obj_type = m_tableInf->object_type[m_index]; - } - m_index++; - return true; - } - return false; - } - case OBJ_TABLE_LIST: - { - if(m_tables) - { - *db_name = Audit_formatter::table_get_db_name(m_tables); - *obj_name = Audit_formatter::table_get_name(m_tables); - if(obj_type) - { - //object is a view if it view command (alter_view, drop_view ..) - //and first object or view field is populated - if((m_firstTable && strstr(getCmdName(), "_view") != NULL) || - Audit_formatter::table_is_view(m_tables)) - { - *obj_type = "VIEW"; - m_firstTable = false; - } - else - { - *obj_type = "TABLE"; - } - } - m_tables = m_tables->next_global; - return true; - } - return false; - } - default : - return false; - } + switch(m_objIterType) + { + case OBJ_DB: + { + if (m_firstTable) + { + *db_name = Audit_formatter::thd_db(getTHD()); + *obj_name = NULL; + if (obj_type) + { + *obj_type = "DATABASE"; + } + m_firstTable = false; + return true; + } + return false; + } + case OBJ_QUERY_CACHE: + { + if (m_index < m_tableInf->num_of_elem && + m_index< MAX_NUM_QUERY_TABLE_ELEM) + { + *db_name = m_tableInf->db[m_index]; + *obj_name = m_tableInf->table_name[m_index]; + if (obj_type) + { + *obj_type = m_tableInf->object_type[m_index]; + } + m_index++; + return true; + } + return false; + } + case OBJ_TABLE_LIST: + { + if (m_tables) + { + *db_name = Audit_formatter::table_get_db_name(m_tables); + *obj_name = Audit_formatter::table_get_name(m_tables); + if (obj_type) + { + // object is a view if it view command (alter_view, drop_view ..) + // and first object or view field is populated + if ((m_firstTable && strstr(getCmdName(), "_view") != NULL) || + Audit_formatter::table_is_view(m_tables)) + { + *obj_type = "VIEW"; + m_firstTable = false; + } + else + { + *obj_type = "TABLE"; + } + } + m_tables = m_tables->next_global; + return true; + } + return false; + } + default: + return false; + } } -pcre * Audit_json_formatter::regex_compile(const char * str) +pcre *Audit_json_formatter::regex_compile(const char *str) { const char *error; int erroffset; - pcre * re = pcre_compile(str, regex_flags, &error, &erroffset, NULL); + pcre *re = pcre_compile(str, regex_flags, &error, &erroffset, NULL); if (!re) { sql_print_error("%s unable to compile regex [%s]. offset: %d message: [%s].", - AUDIT_LOG_PREFIX, str, erroffset, error); + AUDIT_LOG_PREFIX, str, erroffset, error); } return re; } -int Audit_json_formatter::compile_password_masking_regex(const char * str) +bool Audit_json_formatter::compile_password_masking_regex(const char *str) { - //first free existing - if(m_password_mask_regex_compiled) + // first free existing + if (m_password_mask_regex_compiled) { m_password_mask_regex_compiled = false; - //small sleep to let threads oomplete regexc + // small sleep to let threads complete regexec my_sleep(10 * 1000); - pcre_free(m_password_mask_regex_preg); + pcre_free(m_password_mask_regex_preg); } - int error = 1; //default is error (case of empty string) - if(NULL != str && str[0] != '\0') + + bool success = false; // default is error (case of empty string) + if (NULL != str && str[0] != '\0') { - m_password_mask_regex_preg = regex_compile(str); - if(m_password_mask_regex_preg) + m_password_mask_regex_preg = regex_compile(str); + if (m_password_mask_regex_preg) { m_password_mask_regex_compiled = true; - error = 0; - } + success = true; + } } - return error; + return success; } diff --git a/src/audit_offsets.cc b/src/audit_offsets.cc index e906943..063a819 100644 --- a/src/audit_offsets.cc +++ b/src/audit_offsets.cc @@ -11,7 +11,7 @@ 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 */ - + #include "mysql_inc.h" #include "audit_handler.h" @@ -36,394 +36,388 @@ const ThdOffsets thd_offsets_arr[] = {"5.5.47","a35964c285630302290dc1ad31bddd93", 6144, 6192, 3816, 4312, 88, 2592, 96, 0, 32, 104, 120, 6264}, //offsets for: /mysqlrpm/5.6.28/usr/sbin/mysqld (5.6.28) {"5.6.28","a88464e4d2cb6d11311179166613c015", 6992, 7040, 4000, 4520, 72, 2704, 96, 0, 32, 104, 136, 7128}, - //offsets for: /mysqlrpm/5.6.27/usr/sbin/mysqld (5.6.27) - {"5.6.27","212c7e3701046857fa6d7f1404f427d9", 6992, 7040, 4000, 4520, 72, 2704, 96, 0, 32, 104, 136, 7128}, - //offsets for: /mysqlrpm/5.5.46/usr/sbin/mysqld (5.5.46) - {"5.5.46","f2e3131d0aedf9275073225efb4a83c4", 6144, 6192, 3816, 4312, 88, 2592, 96, 0, 32, 104, 120, 6264}, - //offsets for: /mysqlrpm/5.5.45/usr/sbin/mysqld (5.5.45) - {"5.5.45","fc867721baf46f7b6158ad3ded16aa5e", 6144, 6192, 3816, 4312, 88, 2592, 96, 0, 32, 104, 120, 6264}, - //offsets for: /mysqlrpm/5.6.26/usr/sbin/mysqld (5.6.26) - {"5.6.26","560ab8bd2c6513eac8283af1630e604a", 6992, 7040, 4000, 4520, 72, 2704, 96, 0, 32, 104, 136, 7128}, - //offsets for: /mysqlrpm/5.5.44/usr/sbin/mysqld (5.5.44) - {"5.5.44","1291a4a24d7a87415660237d691e821f", 6144, 6192, 3816, 4312, 88, 2592, 96, 0, 32, 104, 120, 6264}, - //offsets for: /mysqlrpm/5.6.25/usr/sbin/mysqld (5.6.25) - {"5.6.25","2e38dabed666cd8521f28e855a43b7ca", 6984, 7032, 4000, 4520, 72, 2704, 96, 0, 32, 104, 136, 7120}, - //offsets for: /mysqlrpm/5.5.43/usr/sbin/mysqld (5.5.43) - {"5.5.43","d9bc90e06a5f97a4e6524bee2cd2ba62", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104, 120, 6256}, - //offsets for: /mysqlrpm/5.6.24/usr/sbin/mysqld (5.6.24) - {"5.6.24","fa139b24fa0074925a76592a3beba284", 6976, 7024, 4000, 4520, 72, 2704, 96, 0, 32, 104, 136, 7112}, - //offsets for: /mysqlrpm/5.5.42/usr/sbin/mysqld (5.5.42) - {"5.5.42","2b3289c6a80d166b0343677c31a99676", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104, 120, 6256}, - //offsets for: /mysqlrpm/5.6.23/usr/sbin/mysqld (5.6.23) - {"5.6.23","088aac6f0be2f01ea83b101c5c327599", 7928, 7976, 3992, 4512, 72, 2704, 96, 0, 32, 104, 136, 8064}, - //offsets for: /mysqlrpm/5.5.41/usr/sbin/mysqld (5.5.41) - {"5.5.41","66afe25ebb34b6099dda39f73f5fe615", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, - //offsets for: /mysqlrpm/5.6.22/usr/sbin/mysqld (5.6.22) - {"5.6.22","6810010c49b77534274fe7ff9943575e", 7928, 7976, 3992, 4512, 72, 2704, 96, 0, 32, 104}, - //offsets for: /mysqlrpm/5.5.40/usr/sbin/mysqld (5.5.40) - {"5.5.40","0ef1c3b1e694a2b780113f4641cb3c67", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, - //offsets for: /mysqlrpm/5.6.21/usr/sbin/mysqld (5.6.21) - {"5.6.21","1dd6c0395ab46ef5464709be16812e06", 7928, 7976, 3992, 4512, 72, 2704, 96, 0, 32, 104}, - //offsets for: /mysqlrpm/5.5.39/usr/sbin/mysqld (5.5.39) - {"5.5.39","fbaf65c0ac5464577e9fce4774260b50", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, - //offsets for: /mysqlrpm/5.6.20/usr/sbin/mysqld (5.6.20) - {"5.6.20","cc7e6ee41d5b2859914dadcd8bbb33c8", 7928, 7976, 3992, 4512, 72, 2704, 96, 0, 32, 104}, - //offsets for: /mysqlrpm/5.5.38/usr/sbin/mysqld (5.5.38) - {"5.5.38","ae5937fbe5856b36b1ac7b0cb400abdd", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, - //offsets for: /mysqlrpm/5.6.19/usr/sbin/mysqld (5.6.19) - {"5.6.19","2a01471dc6b6b59ae25a7efe675d1af4", 7928, 7976, 3992, 4512, 72, 2704, 96, 0, 32, 104}, - - //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) - {"5.1.59-community","9463387bf70c07376a52a93bf44c51f0", 6328, 6392, 3688, 3960, 88, 2048}, - //offsets for: /mysqlrpm/5.1.60/usr/sbin/mysqld (5.1.60-community) - {"5.1.60-community","d9497964e8983a348538c0d05eaee7f0", 6328, 6392, 3688, 3960, 88, 2048}, - //offsets for: /mysqlrpm/5.1.61/usr/sbin/mysqld (5.1.61-community) - {"5.1.61-community","bda6030d35e7fafa5b1e57154a53b804", 6328, 6392, 3688, 3960, 88, 2048}, - //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.1.65/usr/sbin/mysqld (5.1.65-community) - {"5.1.65-community","4df4c0dfe11913bd1ef2bb3a6bc7a40e", 6376, 6440, 3736, 4008, 88, 2056}, - //offsets for: /mysqlrpm/5.1.66/usr/sbin/mysqld (5.1.66-community) - {"5.1.66-community","544ed94102b82425e7592e7d7474fce4", 6376, 6440, 3736, 4008, 88, 2056}, - //offsets for: /mysqlrpm/5.1.67/usr/sbin/mysqld (5.1.67-community) - {"5.1.67-community","f67df6f2416940dbabff460b83b63677", 6376, 6440, 3736, 4008, 88, 2056}, - //offsets for: /mysqlrpm/5.1.68/usr/sbin/mysqld (5.1.68-community) - {"5.1.68-community","4042e9a2778090df6fd8481e03ed6737", 6376, 6440, 3736, 4008, 88, 2056}, - //offsets for: /mysqlrpm/5.1.69/usr/sbin/mysqld (5.1.69-community) - {"5.1.69-community","e9cb524b604419964f4dd55a8c87d618", 6376, 6440, 3736, 4008, 88, 2056}, - - //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 percona rpm (redhat 6): /usr/sbin/mysqld (5.5.21-55) - {"5.5.21-55","e4f1b39e9dca4edc51b8eb6aa09e2fa4", 6464, 6512, 4072, 4512, 88, 2576}, - //offsets for: mysqlrpm/5.5.22/usr/sbin/mysqld (5.5.22) - {"5.5.22","f3592147108e65d92cb18fb4d900c4ab", 6048, 6096, 3800, 4224, 88, 2560}, - //offsets for: Percona-Server-server-55-5.5.22-rel25.2.237.rhel5.x86_64/usr/sbin/mysqld (5.5.22-55) - {"5.5.22-55","0865d71ff0159d3f79f7e277e6010f92", 6456, 6504, 4064, 4504, 104, 2576}, - //offsets for: mysqlrpm/5.5.23/usr/sbin/mysqld (5.5.23) - {"5.5.23","aac33433f75b9758e7f42fad6991fa9e", 6048, 6096, 3800, 4224, 88, 2568}, - //offsets for: mysqlrpm/5.5.24/usr/sbin/mysqld (5.5.24) - {"5.5.24","2915a9dd079446149b17d0d1c478fb11", 6048, 6096, 3800, 4224, 88, 2568}, - //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}, - //offsets for: /mysqlrpm/5.5.27/usr/sbin/mysqld (5.5.27) - {"5.5.27","8a3bd2ea1db328f4443fc25a79450ff3", 6056, 6104, 3808, 4232, 88, 2568}, - //offsets for: /mysqlrpm/5.5.28/usr/sbin/mysqld (5.5.28) - {"5.5.28","588a710a1aec3043203261af72a13219", 6056, 6104, 3808, 4232, 88, 2568}, - //offsets for: /mysqlrpm/5.5.29/usr/sbin/mysqld (5.5.29) - {"5.5.29","c1991059f9db3e4d5f23f34d9ff9c1d5", 6056, 6104, 3808, 4232, 88, 2568}, - //offsets for: cluster-7.2.10-linux-rhel5-x86-64bit/cluster/bin/mysqld (5.5.29-ndb-7.2.10-cluster-commercial-advanced-log) - {"5.5.29-ndb-7.2.10-cluster-commercial-advanced","7fae09caa49af8bced6d250587cc2fcb", 6088, 6136, 3808, 4232, 88, 2568}, - //offsets for: /mysqlrpm/5.5.30/usr/sbin/mysqld (5.5.30) - {"5.5.30","2c92adf1c8c4cef089bd487a56d72288", 6064, 6112, 3816, 4240, 88, 2568}, - //offsets for: mysql-cluster-advanced-7.2.12-linux2.6-x86_64/bin/mysqld (5.5.30-ndb-7.2.12-cluster-commercial-advanced) - {"5.5.30-ndb-7.2.12-cluster-commercial-advanced","9f96bc38bf06a9b18a945227ff9e5c42", 6096, 6144, 3816, 4240, 88, 2568}, - //offsets for: /mysqlrpm/5.5.31/usr/sbin/mysqld (5.5.31) - {"5.5.31","f6604e70b9592f484a7a04a0173f0b25", 6064, 6112, 3816, 4240, 88, 2568}, - - //offsets for: MySQL-server-5.6.10-1.el6.x86_64/usr/sbin/mysqld (5.6.10) - {"5.6.10","7016428728fe057d6825682d30e37b3d", 7808, 7856, 3960, 4400, 72, 2664}, - //offsets for: /mysqlrpm/5.6.10/usr/sbin/mysqld (5.6.10) - {"5.6.10","3b34d181e1d9baa4534fe1146ceb0ce9", 7808, 7856, 3960, 4400, 72, 2664}, - //offsets for: /mysqlrpm/5.6.11/usr/sbin/mysqld (5.6.11) - {"5.6.11","452f9bb49741bfc97d0266120016d77b", 7808, 7856, 3960, 4400, 72, 2672}, - //offsets for: /usr/sbin/mysqld (5.6.12) - {"5.6.12","8ec14d79a5fcb0e9a55b5e4da39b9896", 7816, 7864, 3960, 4400, 72, 2688}, + //offsets for: /mysqlrpm/5.6.27/usr/sbin/mysqld (5.6.27) + {"5.6.27","212c7e3701046857fa6d7f1404f427d9", 6992, 7040, 4000, 4520, 72, 2704, 96, 0, 32, 104, 136, 7128}, + //offsets for: /mysqlrpm/5.5.46/usr/sbin/mysqld (5.5.46) + {"5.5.46","f2e3131d0aedf9275073225efb4a83c4", 6144, 6192, 3816, 4312, 88, 2592, 96, 0, 32, 104, 120, 6264}, + //offsets for: /mysqlrpm/5.5.45/usr/sbin/mysqld (5.5.45) + {"5.5.45","fc867721baf46f7b6158ad3ded16aa5e", 6144, 6192, 3816, 4312, 88, 2592, 96, 0, 32, 104, 120, 6264}, + //offsets for: /mysqlrpm/5.6.26/usr/sbin/mysqld (5.6.26) + {"5.6.26","560ab8bd2c6513eac8283af1630e604a", 6992, 7040, 4000, 4520, 72, 2704, 96, 0, 32, 104, 136, 7128}, + //offsets for: /mysqlrpm/5.5.44/usr/sbin/mysqld (5.5.44) + {"5.5.44","1291a4a24d7a87415660237d691e821f", 6144, 6192, 3816, 4312, 88, 2592, 96, 0, 32, 104, 120, 6264}, + //offsets for: /mysqlrpm/5.6.25/usr/sbin/mysqld (5.6.25) + {"5.6.25","2e38dabed666cd8521f28e855a43b7ca", 6984, 7032, 4000, 4520, 72, 2704, 96, 0, 32, 104, 136, 7120}, + //offsets for: /mysqlrpm/5.5.43/usr/sbin/mysqld (5.5.43) + {"5.5.43","d9bc90e06a5f97a4e6524bee2cd2ba62", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104, 120, 6256}, + //offsets for: /mysqlrpm/5.6.24/usr/sbin/mysqld (5.6.24) + {"5.6.24","fa139b24fa0074925a76592a3beba284", 6976, 7024, 4000, 4520, 72, 2704, 96, 0, 32, 104, 136, 7112}, + //offsets for: /mysqlrpm/5.5.42/usr/sbin/mysqld (5.5.42) + {"5.5.42","2b3289c6a80d166b0343677c31a99676", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104, 120, 6256}, + //offsets for: /mysqlrpm/5.6.23/usr/sbin/mysqld (5.6.23) + {"5.6.23","088aac6f0be2f01ea83b101c5c327599", 7928, 7976, 3992, 4512, 72, 2704, 96, 0, 32, 104, 136, 8064}, + //offsets for: /mysqlrpm/5.5.41/usr/sbin/mysqld (5.5.41) + {"5.5.41","66afe25ebb34b6099dda39f73f5fe615", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, + //offsets for: /mysqlrpm/5.6.22/usr/sbin/mysqld (5.6.22) + {"5.6.22","6810010c49b77534274fe7ff9943575e", 7928, 7976, 3992, 4512, 72, 2704, 96, 0, 32, 104}, + //offsets for: /mysqlrpm/5.5.40/usr/sbin/mysqld (5.5.40) + {"5.5.40","0ef1c3b1e694a2b780113f4641cb3c67", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, + //offsets for: /mysqlrpm/5.6.21/usr/sbin/mysqld (5.6.21) + {"5.6.21","1dd6c0395ab46ef5464709be16812e06", 7928, 7976, 3992, 4512, 72, 2704, 96, 0, 32, 104}, + //offsets for: /mysqlrpm/5.5.39/usr/sbin/mysqld (5.5.39) + {"5.5.39","fbaf65c0ac5464577e9fce4774260b50", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, + //offsets for: /mysqlrpm/5.6.20/usr/sbin/mysqld (5.6.20) + {"5.6.20","cc7e6ee41d5b2859914dadcd8bbb33c8", 7928, 7976, 3992, 4512, 72, 2704, 96, 0, 32, 104}, + //offsets for: /mysqlrpm/5.5.38/usr/sbin/mysqld (5.5.38) + {"5.5.38","ae5937fbe5856b36b1ac7b0cb400abdd", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, + //offsets for: /mysqlrpm/5.6.19/usr/sbin/mysqld (5.6.19) + {"5.6.19","2a01471dc6b6b59ae25a7efe675d1af4", 7928, 7976, 3992, 4512, 72, 2704, 96, 0, 32, 104}, + //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) + {"5.1.59-community","9463387bf70c07376a52a93bf44c51f0", 6328, 6392, 3688, 3960, 88, 2048}, + //offsets for: /mysqlrpm/5.1.60/usr/sbin/mysqld (5.1.60-community) + {"5.1.60-community","d9497964e8983a348538c0d05eaee7f0", 6328, 6392, 3688, 3960, 88, 2048}, + //offsets for: /mysqlrpm/5.1.61/usr/sbin/mysqld (5.1.61-community) + {"5.1.61-community","bda6030d35e7fafa5b1e57154a53b804", 6328, 6392, 3688, 3960, 88, 2048}, + //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.1.65/usr/sbin/mysqld (5.1.65-community) + {"5.1.65-community","4df4c0dfe11913bd1ef2bb3a6bc7a40e", 6376, 6440, 3736, 4008, 88, 2056}, + //offsets for: /mysqlrpm/5.1.66/usr/sbin/mysqld (5.1.66-community) + {"5.1.66-community","544ed94102b82425e7592e7d7474fce4", 6376, 6440, 3736, 4008, 88, 2056}, + //offsets for: /mysqlrpm/5.1.67/usr/sbin/mysqld (5.1.67-community) + {"5.1.67-community","f67df6f2416940dbabff460b83b63677", 6376, 6440, 3736, 4008, 88, 2056}, + //offsets for: /mysqlrpm/5.1.68/usr/sbin/mysqld (5.1.68-community) + {"5.1.68-community","4042e9a2778090df6fd8481e03ed6737", 6376, 6440, 3736, 4008, 88, 2056}, + //offsets for: /mysqlrpm/5.1.69/usr/sbin/mysqld (5.1.69-community) + {"5.1.69-community","e9cb524b604419964f4dd55a8c87d618", 6376, 6440, 3736, 4008, 88, 2056}, + //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 percona rpm (redhat 6): /usr/sbin/mysqld (5.5.21-55) + {"5.5.21-55","e4f1b39e9dca4edc51b8eb6aa09e2fa4", 6464, 6512, 4072, 4512, 88, 2576}, + //offsets for: mysqlrpm/5.5.22/usr/sbin/mysqld (5.5.22) + {"5.5.22","f3592147108e65d92cb18fb4d900c4ab", 6048, 6096, 3800, 4224, 88, 2560}, + //offsets for: Percona-Server-server-55-5.5.22-rel25.2.237.rhel5.x86_64/usr/sbin/mysqld (5.5.22-55) + {"5.5.22-55","0865d71ff0159d3f79f7e277e6010f92", 6456, 6504, 4064, 4504, 104, 2576}, + //offsets for: mysqlrpm/5.5.23/usr/sbin/mysqld (5.5.23) + {"5.5.23","aac33433f75b9758e7f42fad6991fa9e", 6048, 6096, 3800, 4224, 88, 2568}, + //offsets for: mysqlrpm/5.5.24/usr/sbin/mysqld (5.5.24) + {"5.5.24","2915a9dd079446149b17d0d1c478fb11", 6048, 6096, 3800, 4224, 88, 2568}, + //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}, + //offsets for: /mysqlrpm/5.5.27/usr/sbin/mysqld (5.5.27) + {"5.5.27","8a3bd2ea1db328f4443fc25a79450ff3", 6056, 6104, 3808, 4232, 88, 2568}, + //offsets for: /mysqlrpm/5.5.28/usr/sbin/mysqld (5.5.28) + {"5.5.28","588a710a1aec3043203261af72a13219", 6056, 6104, 3808, 4232, 88, 2568}, + //offsets for: /mysqlrpm/5.5.29/usr/sbin/mysqld (5.5.29) + {"5.5.29","c1991059f9db3e4d5f23f34d9ff9c1d5", 6056, 6104, 3808, 4232, 88, 2568}, + //offsets for: cluster-7.2.10-linux-rhel5-x86-64bit/cluster/bin/mysqld (5.5.29-ndb-7.2.10-cluster-commercial-advanced-log) + {"5.5.29-ndb-7.2.10-cluster-commercial-advanced","7fae09caa49af8bced6d250587cc2fcb", 6088, 6136, 3808, 4232, 88, 2568}, + //offsets for: /mysqlrpm/5.5.30/usr/sbin/mysqld (5.5.30) + {"5.5.30","2c92adf1c8c4cef089bd487a56d72288", 6064, 6112, 3816, 4240, 88, 2568}, + //offsets for: mysql-cluster-advanced-7.2.12-linux2.6-x86_64/bin/mysqld (5.5.30-ndb-7.2.12-cluster-commercial-advanced) + {"5.5.30-ndb-7.2.12-cluster-commercial-advanced","9f96bc38bf06a9b18a945227ff9e5c42", 6096, 6144, 3816, 4240, 88, 2568}, + //offsets for: /mysqlrpm/5.5.31/usr/sbin/mysqld (5.5.31) + {"5.5.31","f6604e70b9592f484a7a04a0173f0b25", 6064, 6112, 3816, 4240, 88, 2568}, + //offsets for: MySQL-server-5.6.10-1.el6.x86_64/usr/sbin/mysqld (5.6.10) + {"5.6.10","7016428728fe057d6825682d30e37b3d", 7808, 7856, 3960, 4400, 72, 2664}, + //offsets for: /mysqlrpm/5.6.10/usr/sbin/mysqld (5.6.10) + {"5.6.10","3b34d181e1d9baa4534fe1146ceb0ce9", 7808, 7856, 3960, 4400, 72, 2664}, + //offsets for: /mysqlrpm/5.6.11/usr/sbin/mysqld (5.6.11) + {"5.6.11","452f9bb49741bfc97d0266120016d77b", 7808, 7856, 3960, 4400, 72, 2672}, + //offsets for: /usr/sbin/mysqld (5.6.12) + {"5.6.12","8ec14d79a5fcb0e9a55b5e4da39b9896", 7816, 7864, 3960, 4400, 72, 2688}, - //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}, - {"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) - {"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.1.65/bin/mysqld (5.1.65) - {"5.1.65","65d905e173c06316b736ee4e9be15baf", 6392, 6456, 3752, 4024, 88, 2056}, - //offsets for: /mysql/5.1.66/bin/mysqld (5.1.66) - {"5.1.66","2cd9a97779d436d1d5d045eb12620ef0", 6392, 6456, 3752, 4024, 88, 2056}, - //offsets for: /mysql/5.1.67/bin/mysqld (5.1.67) - {"5.1.67","a33947226f24f59d30e7c40c61d840ca", 6392, 6456, 3752, 4024, 88, 2056}, - //offsets for: /mysql/5.1.68/bin/mysqld (5.1.68) - {"5.1.68","673dd031ea4ad3493b47d74662a49079", 6392, 6456, 3752, 4024, 88, 2056}, - //offsets for: /mysql/5.1.69/bin/mysqld (5.1.69) - {"5.1.69","af2936f85db019bfd44c7e12a2138707", 6392, 6456, 3752, 4024, 88, 2056}, - - //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 percona: Percona-Server-5.5.21-rel25.0-227.Linux.x86_64/bin/mysqld (5.5.21-rel25.0) - {"5.5.21-rel25.0","346a87d97dbf5d7aad3a9f7f707f9477", 6464, 6512, 4072, 4512, 88, 2576}, - //offsets for: /mysql/5.5.22/bin/mysqld (5.5.22) - {"5.5.22","9152de65a0de0594f46e1db0d0c9a182", 6048, 6096, 3800, 4224, 88, 2560}, - //offsets for: /mysql/5.5.23/bin/mysqld (5.5.23) - {"5.5.23","da3c9d8e3bf1c1235d283cbfad1631ab", 6048, 6096, 3800, 4224, 88, 2568}, - //offsets for: /mysql/5.5.24/bin/mysqld (5.5.24) - {"5.5.24","5cb90eb8d4080f50fd7a432ad9eb75e0", 6048, 6096, 3800, 4224, 88, 2568}, - //offsets for: /mysql/5.5.25/bin/mysqld (5.5.25) - {"5.5.25","3c19465f6b6f2daecb7a2d7ac1592824", 6056, 6104, 3808, 4232, 88, 2568}, - //offsets for: /mysql/5.5.27/bin/mysqld (5.5.27) - {"5.5.27","0c6d305da14143ac17bf8964243234a4", 6056, 6104, 3808, 4232, 88, 2568}, - //offsets for: /mysql/5.5.28/bin/mysqld (5.5.28) - {"5.5.28","8fbd19126907af43440baa4584dc7d28", 6056, 6104, 3808, 4232, 88, 2568}, - //offsets for: /mysql/5.5.29/bin/mysqld (5.5.29) - {"5.5.29","495fc2576127ab851baa1ebb39a8f6fe", 6056, 6104, 3808, 4232, 88, 2568}, - //offsets for: /mysql/5.5.30/bin/mysqld (5.5.30) - {"5.5.30","a2a8aba9c124315c17634556a303f87a", 6064, 6112, 3816, 4240, 88, 2568}, - //offsets for: MySQL-server-5.5.31-2.rhel5.x86_64/usr/sbin/mysqld (5.5.31) - {"5.5.31","858dc19ffc5d34e669ab85d32a8a0623", 6064, 6112, 3816, 4240, 88, 2568}, - //offsets for: /mysql/5.5.31/bin/mysqld (5.5.31) - {"5.5.31","61e65a4cc9360e03f3810ef2928c916d", 6064, 6112, 3816, 4240, 88, 2568}, - - //offsets for: /mysql/5.6.10/bin/mysqld (5.6.10) - {"5.6.10","37f9c31dd092bb2d0da7eb6e2098732f", 7808, 7856, 3960, 4400, 72, 2664}, - //offsets for: /mysql/5.6.11/bin/mysqld (5.6.11) - {"5.6.11","85fd884192cc5cd12fba52b7b140c819", 7808, 7856, 3960, 4400, 72, 2672}, - - //offsets for: /mysqlrpm/5.1.70/usr/sbin/mysqld (5.1.70-community) - {"5.1.70-community","e70f9d48dad2a30b24e6c2744bed94d2", 6376, 6440, 3736, 4008, 88, 2072}, - //offsets for: /mysqlrpm/5.5.32/usr/sbin/mysqld (5.5.32) - {"5.5.32","0a8f2dab859c59656a7ee18f1c97746b", 6064, 6112, 3816, 4240, 88, 2592}, - //offsets for: /mysqlrpm/5.6.12/usr/sbin/mysqld (5.6.12) - {"5.6.12","647c61f9e2e42a6b8af67ad7f3268858", 7816, 7864, 3960, 4400, 72, 2688}, - //offsets for: /mysql/5.1.70/bin/mysqld (5.1.70) - {"5.1.70","67b86b3ffff1196ac6702a89cd41ff84", 6392, 6456, 3752, 4024, 88, 2072}, - //offsets for: /mysql/5.5.32/bin/mysqld (5.5.32) - {"5.5.32","97829c2915124a7cfa605d3f39bea354", 6064, 6112, 3816, 4240, 88, 2592}, - //offsets for: /mysql/5.6.12/bin/mysqld (5.6.12) - {"5.6.12","3a6bb81a7f1239eb810a06a3b0c5dc2a", 7816, 7864, 3960, 4400, 72, 2688}, - //offsets for: /mysqlrpm/5.1.71/usr/sbin/mysqld (5.1.71-community) - {"5.1.71-community","c8453ca637925c878356ca43eef8f654", 6376, 6440, 3736, 4008, 88, 2072}, - //offsets for: /mysqlrpm/5.5.33/usr/sbin/mysqld (5.5.33) - {"5.5.33","88b02a9e61f5faedcf2d64a9b0239f38", 6064, 6112, 3816, 4240, 88, 2592}, - //offsets for: /mysqlrpm/5.6.13/usr/sbin/mysqld (5.6.13) - {"5.6.13","441bbd39cf3df4847289f4cd4b2b3dc3", 7816, 7864, 3960, 4400, 72, 2688}, - //offsets for: /mysql/5.1.71/bin/mysqld (5.1.71) - {"5.1.71","f648e9c956c85fbb1fbe8250df518755", 6392, 6456, 3752, 4024, 88, 2072}, - //offsets for: /mysql/5.5.33/bin/mysqld (5.5.33) - {"5.5.33","59bf9fe80d6005e38238bc083b5aef51", 6064, 6112, 3816, 4240, 88, 2592}, - //offsets for: /mysql/5.6.13/bin/mysqld (5.6.13) - {"5.6.13","137c18e72cfe17d4fcacda209e405234", 7816, 7864, 3960, 4400, 72, 2688}, - //offsets for: /mysql-5.5.34-linux2.6-x86_64/bin/mysqld (5.5.34) - {"5.5.34","94d083ef0a7f964dedb94684eb06c7e7", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, - //offsets for: /mysqlrpm/5.5.34/usr/sbin/mysqld (5.5.34) - {"5.5.34","b146111cae431cbb3d20322cc0a8e3be", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, - //offsets for: /mysqlrpm/5.6.14/usr/sbin/mysqld (5.6.14) - {"5.6.14","42907ed406036f7d651a73547a611be0", 7888, 7936, 3960, 4472, 72, 2696, 96, 0, 32, 104}, - //offsets for: /mysqlrpm/5.1.72/usr/sbin/mysqld (5.1.72-community) - {"5.1.72-community","c53f0d8b4d400755e8c476cd512dcea3", 6384, 6448, 3736, 4008, 88, 2072, 8, 0, 24, 16}, - //offsets for: /mysql/5.1.72/bin/mysqld (5.1.72) - {"5.1.72","f560445d3c5f98a88d50878b2cd661c0", 6400, 6464, 3752, 4024, 88, 2072, 8, 0, 24, 16}, - //offsets for: /mysqlrpm/5.1.73/usr/sbin/mysqld (5.1.73-community) - {"5.1.73-community","85cdb461556846fb29cbbaae49dfde94", 6384, 6448, 3736, 4008, 88, 2072, 8, 0, 24, 16}, - //offsets for: /mysqlrpm/5.5.35/usr/sbin/mysqld (5.5.35) - {"5.5.35","09c5971f9df91d9fde18e969f66d9ff7", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, - //offsets for: /mysqlrpm/5.6.15/usr/sbin/mysqld (5.6.15) - {"5.6.15","dbd2d20241e4e59412b5d2bff97513da", 7920, 7968, 3984, 4504, 72, 2704, 96, 0, 32, 104}, - //offsets for: /mysql/5.1.73/bin/mysqld (5.1.73) - {"5.1.73","c84e4519e1ada16c245a87170bf1c3f0", 6400, 6464, 3752, 4024, 88, 2072, 8, 0, 24, 16}, - //offsets for: /mysqlrpm/5.5.36/usr/sbin/mysqld (5.5.36) - {"5.5.36","c88f67a152a2f9d74b8fd3ef182418be", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, - //offsets for: /mysqlrpm/5.6.16/usr/sbin/mysqld (5.6.16) - {"5.6.16","5f5ef8d06a3ead4f0bfa2e43edc69898", 7920, 7968, 3984, 4504, 72, 2704, 96, 0, 32, 104}, - //offsets for: /mysql/5.5.36/bin/mysqld (5.5.36) - {"5.5.36","f5595334dd163428d54a546b11b8e205", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, - //offsets for: /mysql/5.6.16/bin/mysqld (5.6.16) - {"5.6.16","b50b5c83341099b9cd6f6749dfd71bca", 7920, 7968, 3984, 4504, 72, 2704, 96, 0, 32, 104}, - //offsets for: /mysqlrpm/5.6.17/usr/sbin/mysqld (5.6.17) - {"5.6.17","972845b7f80376956fc1db46ec88f72e", 7928, 7976, 3992, 4512, 72, 2704, 96, 0, 32, 104}, - //offsets for: /mysql/5.6.17/bin/mysqld (5.6.17) - {"5.6.17","525a28e1f7b05b2b03111f5f521b428d", 7928, 7976, 3992, 4512, 72, 2704, 96, 0, 32, 104}, - //offsets for: /mysqlrpm/5.5.37/usr/sbin/mysqld (5.5.37) - {"5.5.37","1a2d5e421f97381578cf037b69e90200", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104} + //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}, + {"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) + {"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.1.65/bin/mysqld (5.1.65) + {"5.1.65","65d905e173c06316b736ee4e9be15baf", 6392, 6456, 3752, 4024, 88, 2056}, + //offsets for: /mysql/5.1.66/bin/mysqld (5.1.66) + {"5.1.66","2cd9a97779d436d1d5d045eb12620ef0", 6392, 6456, 3752, 4024, 88, 2056}, + //offsets for: /mysql/5.1.67/bin/mysqld (5.1.67) + {"5.1.67","a33947226f24f59d30e7c40c61d840ca", 6392, 6456, 3752, 4024, 88, 2056}, + //offsets for: /mysql/5.1.68/bin/mysqld (5.1.68) + {"5.1.68","673dd031ea4ad3493b47d74662a49079", 6392, 6456, 3752, 4024, 88, 2056}, + //offsets for: /mysql/5.1.69/bin/mysqld (5.1.69) + {"5.1.69","af2936f85db019bfd44c7e12a2138707", 6392, 6456, 3752, 4024, 88, 2056}, + //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 percona: Percona-Server-5.5.21-rel25.0-227.Linux.x86_64/bin/mysqld (5.5.21-rel25.0) + {"5.5.21-rel25.0","346a87d97dbf5d7aad3a9f7f707f9477", 6464, 6512, 4072, 4512, 88, 2576}, + //offsets for: /mysql/5.5.22/bin/mysqld (5.5.22) + {"5.5.22","9152de65a0de0594f46e1db0d0c9a182", 6048, 6096, 3800, 4224, 88, 2560}, + //offsets for: /mysql/5.5.23/bin/mysqld (5.5.23) + {"5.5.23","da3c9d8e3bf1c1235d283cbfad1631ab", 6048, 6096, 3800, 4224, 88, 2568}, + //offsets for: /mysql/5.5.24/bin/mysqld (5.5.24) + {"5.5.24","5cb90eb8d4080f50fd7a432ad9eb75e0", 6048, 6096, 3800, 4224, 88, 2568}, + //offsets for: /mysql/5.5.25/bin/mysqld (5.5.25) + {"5.5.25","3c19465f6b6f2daecb7a2d7ac1592824", 6056, 6104, 3808, 4232, 88, 2568}, + //offsets for: /mysql/5.5.27/bin/mysqld (5.5.27) + {"5.5.27","0c6d305da14143ac17bf8964243234a4", 6056, 6104, 3808, 4232, 88, 2568}, + //offsets for: /mysql/5.5.28/bin/mysqld (5.5.28) + {"5.5.28","8fbd19126907af43440baa4584dc7d28", 6056, 6104, 3808, 4232, 88, 2568}, + //offsets for: /mysql/5.5.29/bin/mysqld (5.5.29) + {"5.5.29","495fc2576127ab851baa1ebb39a8f6fe", 6056, 6104, 3808, 4232, 88, 2568}, + //offsets for: /mysql/5.5.30/bin/mysqld (5.5.30) + {"5.5.30","a2a8aba9c124315c17634556a303f87a", 6064, 6112, 3816, 4240, 88, 2568}, + //offsets for: MySQL-server-5.5.31-2.rhel5.x86_64/usr/sbin/mysqld (5.5.31) + {"5.5.31","858dc19ffc5d34e669ab85d32a8a0623", 6064, 6112, 3816, 4240, 88, 2568}, + //offsets for: /mysql/5.5.31/bin/mysqld (5.5.31) + {"5.5.31","61e65a4cc9360e03f3810ef2928c916d", 6064, 6112, 3816, 4240, 88, 2568}, + //offsets for: /mysql/5.6.10/bin/mysqld (5.6.10) + {"5.6.10","37f9c31dd092bb2d0da7eb6e2098732f", 7808, 7856, 3960, 4400, 72, 2664}, + //offsets for: /mysql/5.6.11/bin/mysqld (5.6.11) + {"5.6.11","85fd884192cc5cd12fba52b7b140c819", 7808, 7856, 3960, 4400, 72, 2672}, + //offsets for: /mysqlrpm/5.1.70/usr/sbin/mysqld (5.1.70-community) + {"5.1.70-community","e70f9d48dad2a30b24e6c2744bed94d2", 6376, 6440, 3736, 4008, 88, 2072}, + //offsets for: /mysqlrpm/5.5.32/usr/sbin/mysqld (5.5.32) + {"5.5.32","0a8f2dab859c59656a7ee18f1c97746b", 6064, 6112, 3816, 4240, 88, 2592}, + //offsets for: /mysqlrpm/5.6.12/usr/sbin/mysqld (5.6.12) + {"5.6.12","647c61f9e2e42a6b8af67ad7f3268858", 7816, 7864, 3960, 4400, 72, 2688}, + //offsets for: /mysql/5.1.70/bin/mysqld (5.1.70) + {"5.1.70","67b86b3ffff1196ac6702a89cd41ff84", 6392, 6456, 3752, 4024, 88, 2072}, + //offsets for: /mysql/5.5.32/bin/mysqld (5.5.32) + {"5.5.32","97829c2915124a7cfa605d3f39bea354", 6064, 6112, 3816, 4240, 88, 2592}, + //offsets for: /mysql/5.6.12/bin/mysqld (5.6.12) + {"5.6.12","3a6bb81a7f1239eb810a06a3b0c5dc2a", 7816, 7864, 3960, 4400, 72, 2688}, + //offsets for: /mysqlrpm/5.1.71/usr/sbin/mysqld (5.1.71-community) + {"5.1.71-community","c8453ca637925c878356ca43eef8f654", 6376, 6440, 3736, 4008, 88, 2072}, + //offsets for: /mysqlrpm/5.5.33/usr/sbin/mysqld (5.5.33) + {"5.5.33","88b02a9e61f5faedcf2d64a9b0239f38", 6064, 6112, 3816, 4240, 88, 2592}, + //offsets for: /mysqlrpm/5.6.13/usr/sbin/mysqld (5.6.13) + {"5.6.13","441bbd39cf3df4847289f4cd4b2b3dc3", 7816, 7864, 3960, 4400, 72, 2688}, + //offsets for: /mysql/5.1.71/bin/mysqld (5.1.71) + {"5.1.71","f648e9c956c85fbb1fbe8250df518755", 6392, 6456, 3752, 4024, 88, 2072}, + //offsets for: /mysql/5.5.33/bin/mysqld (5.5.33) + {"5.5.33","59bf9fe80d6005e38238bc083b5aef51", 6064, 6112, 3816, 4240, 88, 2592}, + //offsets for: /mysql/5.6.13/bin/mysqld (5.6.13) + {"5.6.13","137c18e72cfe17d4fcacda209e405234", 7816, 7864, 3960, 4400, 72, 2688}, + //offsets for: /mysql-5.5.34-linux2.6-x86_64/bin/mysqld (5.5.34) + {"5.5.34","94d083ef0a7f964dedb94684eb06c7e7", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, + //offsets for: /mysqlrpm/5.5.34/usr/sbin/mysqld (5.5.34) + {"5.5.34","b146111cae431cbb3d20322cc0a8e3be", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, + //offsets for: /mysqlrpm/5.6.14/usr/sbin/mysqld (5.6.14) + {"5.6.14","42907ed406036f7d651a73547a611be0", 7888, 7936, 3960, 4472, 72, 2696, 96, 0, 32, 104}, + //offsets for: /mysqlrpm/5.1.72/usr/sbin/mysqld (5.1.72-community) + {"5.1.72-community","c53f0d8b4d400755e8c476cd512dcea3", 6384, 6448, 3736, 4008, 88, 2072, 8, 0, 24, 16}, + //offsets for: /mysql/5.1.72/bin/mysqld (5.1.72) + {"5.1.72","f560445d3c5f98a88d50878b2cd661c0", 6400, 6464, 3752, 4024, 88, 2072, 8, 0, 24, 16}, + //offsets for: /mysqlrpm/5.1.73/usr/sbin/mysqld (5.1.73-community) + {"5.1.73-community","85cdb461556846fb29cbbaae49dfde94", 6384, 6448, 3736, 4008, 88, 2072, 8, 0, 24, 16}, + //offsets for: /mysqlrpm/5.5.35/usr/sbin/mysqld (5.5.35) + {"5.5.35","09c5971f9df91d9fde18e969f66d9ff7", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, + //offsets for: /mysqlrpm/5.6.15/usr/sbin/mysqld (5.6.15) + {"5.6.15","dbd2d20241e4e59412b5d2bff97513da", 7920, 7968, 3984, 4504, 72, 2704, 96, 0, 32, 104}, + //offsets for: /mysql/5.1.73/bin/mysqld (5.1.73) + {"5.1.73","c84e4519e1ada16c245a87170bf1c3f0", 6400, 6464, 3752, 4024, 88, 2072, 8, 0, 24, 16}, + //offsets for: /mysqlrpm/5.5.36/usr/sbin/mysqld (5.5.36) + {"5.5.36","c88f67a152a2f9d74b8fd3ef182418be", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, + //offsets for: /mysqlrpm/5.6.16/usr/sbin/mysqld (5.6.16) + {"5.6.16","5f5ef8d06a3ead4f0bfa2e43edc69898", 7920, 7968, 3984, 4504, 72, 2704, 96, 0, 32, 104}, + //offsets for: /mysql/5.5.36/bin/mysqld (5.5.36) + {"5.5.36","f5595334dd163428d54a546b11b8e205", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104}, + //offsets for: /mysql/5.6.16/bin/mysqld (5.6.16) + {"5.6.16","b50b5c83341099b9cd6f6749dfd71bca", 7920, 7968, 3984, 4504, 72, 2704, 96, 0, 32, 104}, + //offsets for: /mysqlrpm/5.6.17/usr/sbin/mysqld (5.6.17) + {"5.6.17","972845b7f80376956fc1db46ec88f72e", 7928, 7976, 3992, 4512, 72, 2704, 96, 0, 32, 104}, + //offsets for: /mysql/5.6.17/bin/mysqld (5.6.17) + {"5.6.17","525a28e1f7b05b2b03111f5f521b428d", 7928, 7976, 3992, 4512, 72, 2704, 96, 0, 32, 104}, + //offsets for: /mysqlrpm/5.5.37/usr/sbin/mysqld (5.5.37) + {"5.5.37","1a2d5e421f97381578cf037b69e90200", 6136, 6184, 3816, 4312, 88, 2592, 96, 0, 32, 104} }; #else @@ -445,374 +439,367 @@ const ThdOffsets thd_offsets_arr[] = {"5.5.47","669f76493658cd2758af28a1c391391a", 3872, 3900, 2368, 2748, 44, 1656, 60, 0, 20, 64, 60, 3956}, //offsets for: /mysqlrpm/5.6.28/usr/sbin/mysqld (5.6.28) {"5.6.28","b108d8002c70f9e6bf57b6c47f1b4a74", 4676, 4704, 2660, 3052, 36, 1748, 60, 0, 20, 64, 72, 4776}, - //offsets for: /mysqlrpm/5.6.27/usr/sbin/mysqld (5.6.27) - {"5.6.27","66d0b372d6eb134730c43bdb1c2ac4e5", 4672, 4700, 2660, 3052, 36, 1748, 60, 0, 20, 64, 72, 4772}, - //offsets for: /mysqlrpm/5.5.46/usr/sbin/mysqld (5.5.46) - {"5.5.46","ad19ca91985eaafe185c0a3f4e51fd9a", 3872, 3900, 2368, 2748, 44, 1656, 60, 0, 20, 64, 60, 3956}, - //offsets for: /mysqlrpm/5.5.45/usr/sbin/mysqld (5.5.45) - {"5.5.45","c91cfb5d8b250a40d626d4fe1bc89fdd", 3872, 3900, 2368, 2748, 44, 1656, 60, 0, 20, 64, 60, 3956}, - //offsets for: /mysqlrpm/5.6.26/usr/sbin/mysqld (5.6.26) - {"5.6.26","1cb4e5089554ae6b92569955980b95aa", 4672, 4700, 2660, 3052, 36, 1748, 60, 0, 20, 64, 72, 4772}, - //offsets for: /mysqlrpm/5.5.44/usr/sbin/mysqld (5.5.44) - {"5.5.44","e69b8c103a28a09dbe6aedd1b3b433f8", 3872, 3900, 2368, 2748, 44, 1656, 60, 0, 20, 64, 60, 3956}, - //offsets for: /mysqlrpm/5.6.25/usr/sbin/mysqld (5.6.25) - {"5.6.25","2e90f40fd72446f7c68e662ab4b51ee9", 4672, 4700, 2660, 3052, 36, 1748, 60, 0, 20, 64, 72, 4772}, - //offsets for: /mysqlrpm/5.5.43/usr/sbin/mysqld (5.5.43) - {"5.5.43","5bb9944b00a46765a12e6a3a261e10fa", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64, 60, 3952}, - //offsets for: /mysqlrpm/5.6.24/usr/sbin/mysqld (5.6.24) - {"5.6.24","55aab9806d2b88fe1fe0ab66dd2017eb", 4668, 4696, 2660, 3052, 36, 1748, 60, 0, 20, 64, 72, 4768}, - //offsets for: /mysqlrpm/5.5.42/usr/sbin/mysqld (5.5.42) - {"5.5.42","e0e62892aeb511bcfe92fcd95bf90fcb", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64, 60, 3952}, - //offsets for: /mysqlrpm/5.6.23/usr/sbin/mysqld (5.6.23) - {"5.6.23","727e1bd34328073ec9cdfd2d564fd5ce", 5652, 5680, 2656, 3048, 36, 1748, 60, 0, 20, 64, 72, 5752}, - //offsets for: /mysqlrpm/5.5.41/usr/sbin/mysqld (5.5.41) - {"5.5.41","b234951450a025962337644f8895420a", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64}, - //offsets for: /mysqlrpm/5.6.22/usr/sbin/mysqld (5.6.22) - {"5.6.22","5835e81c4b1e6b26dc91ab7734791a63", 5652, 5680, 2656, 3048, 36, 1748, 60, 0, 20, 64}, - //offsets for: /mysqlrpm/5.5.40/usr/sbin/mysqld (5.5.40) - {"5.5.40","a1549dfa57facd1bc63ba130d359c206", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64}, - //offsets for: /mysqlrpm/5.6.21/usr/sbin/mysqld (5.6.21) - {"5.6.21","87425fea7e02c944eb0f0a674b7c0058", 5652, 5680, 2656, 3048, 36, 1748, 60, 0, 20, 64}, - //offsets for: /mysqlrpm/5.5.39/usr/sbin/mysqld (5.5.39) - {"5.5.39","0a43c59be487d93a14322628464a5b1f", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64}, - //offsets for: /mysqlrpm/5.6.20/usr/sbin/mysqld (5.6.20) - {"5.6.20","a6d6d22e1bbd79c704a4809188fe1773", 5652, 5680, 2656, 3048, 36, 1748, 60, 0, 20, 64}, - //offsets for: /mysqlrpm/5.5.38/usr/sbin/mysqld (5.5.38) - {"5.5.38","89e8b85dd5731e15df3d5597020c0ec8", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64}, - //offsets for: /mysqlrpm/5.6.19/usr/sbin/mysqld (5.6.19) - {"5.6.19","3f94430e20b564951159aa78627df97f", 5652, 5680, 2656, 3048, 36, 1748, 60, 0, 20, 64}, + //offsets for: /mysqlrpm/5.6.27/usr/sbin/mysqld (5.6.27) + {"5.6.27","66d0b372d6eb134730c43bdb1c2ac4e5", 4672, 4700, 2660, 3052, 36, 1748, 60, 0, 20, 64, 72, 4772}, + //offsets for: /mysqlrpm/5.5.46/usr/sbin/mysqld (5.5.46) + {"5.5.46","ad19ca91985eaafe185c0a3f4e51fd9a", 3872, 3900, 2368, 2748, 44, 1656, 60, 0, 20, 64, 60, 3956}, + //offsets for: /mysqlrpm/5.5.45/usr/sbin/mysqld (5.5.45) + {"5.5.45","c91cfb5d8b250a40d626d4fe1bc89fdd", 3872, 3900, 2368, 2748, 44, 1656, 60, 0, 20, 64, 60, 3956}, + //offsets for: /mysqlrpm/5.6.26/usr/sbin/mysqld (5.6.26) + {"5.6.26","1cb4e5089554ae6b92569955980b95aa", 4672, 4700, 2660, 3052, 36, 1748, 60, 0, 20, 64, 72, 4772}, + //offsets for: /mysqlrpm/5.5.44/usr/sbin/mysqld (5.5.44) + {"5.5.44","e69b8c103a28a09dbe6aedd1b3b433f8", 3872, 3900, 2368, 2748, 44, 1656, 60, 0, 20, 64, 60, 3956}, + //offsets for: /mysqlrpm/5.6.25/usr/sbin/mysqld (5.6.25) + {"5.6.25","2e90f40fd72446f7c68e662ab4b51ee9", 4672, 4700, 2660, 3052, 36, 1748, 60, 0, 20, 64, 72, 4772}, + //offsets for: /mysqlrpm/5.5.43/usr/sbin/mysqld (5.5.43) + {"5.5.43","5bb9944b00a46765a12e6a3a261e10fa", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64, 60, 3952}, + //offsets for: /mysqlrpm/5.6.24/usr/sbin/mysqld (5.6.24) + {"5.6.24","55aab9806d2b88fe1fe0ab66dd2017eb", 4668, 4696, 2660, 3052, 36, 1748, 60, 0, 20, 64, 72, 4768}, + //offsets for: /mysqlrpm/5.5.42/usr/sbin/mysqld (5.5.42) + {"5.5.42","e0e62892aeb511bcfe92fcd95bf90fcb", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64, 60, 3952}, + //offsets for: /mysqlrpm/5.6.23/usr/sbin/mysqld (5.6.23) + {"5.6.23","727e1bd34328073ec9cdfd2d564fd5ce", 5652, 5680, 2656, 3048, 36, 1748, 60, 0, 20, 64, 72, 5752}, + //offsets for: /mysqlrpm/5.5.41/usr/sbin/mysqld (5.5.41) + {"5.5.41","b234951450a025962337644f8895420a", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64}, + //offsets for: /mysqlrpm/5.6.22/usr/sbin/mysqld (5.6.22) + {"5.6.22","5835e81c4b1e6b26dc91ab7734791a63", 5652, 5680, 2656, 3048, 36, 1748, 60, 0, 20, 64}, + //offsets for: /mysqlrpm/5.5.40/usr/sbin/mysqld (5.5.40) + {"5.5.40","a1549dfa57facd1bc63ba130d359c206", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64}, + //offsets for: /mysqlrpm/5.6.21/usr/sbin/mysqld (5.6.21) + {"5.6.21","87425fea7e02c944eb0f0a674b7c0058", 5652, 5680, 2656, 3048, 36, 1748, 60, 0, 20, 64}, + //offsets for: /mysqlrpm/5.5.39/usr/sbin/mysqld (5.5.39) + {"5.5.39","0a43c59be487d93a14322628464a5b1f", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64}, + //offsets for: /mysqlrpm/5.6.20/usr/sbin/mysqld (5.6.20) + {"5.6.20","a6d6d22e1bbd79c704a4809188fe1773", 5652, 5680, 2656, 3048, 36, 1748, 60, 0, 20, 64}, + //offsets for: /mysqlrpm/5.5.38/usr/sbin/mysqld (5.5.38) + {"5.5.38","89e8b85dd5731e15df3d5597020c0ec8", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64}, + //offsets for: /mysqlrpm/5.6.19/usr/sbin/mysqld (5.6.19) + {"5.6.19","3f94430e20b564951159aa78627df97f", 5652, 5680, 2656, 3048, 36, 1748, 60, 0, 20, 64}, + //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.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.1.65/usr/sbin/mysqld (5.1.65-community) + {"5.1.65-community","0e96922fe95be696f7f91fc5a94c5d46", 4124, 4164, 2268, 2448, 44, 1180}, + //offsets for: /mysqlrpm/5.1.66/usr/sbin/mysqld (5.1.66-community) + {"5.1.66-community","60049b5c82e3479323001ffb28447820", 4124, 4164, 2268, 2448, 44, 1180}, + //offsets for: /mysqlrpm/5.1.67/usr/sbin/mysqld (5.1.67-community) + {"5.1.67-community","2ca1d344c7054644a7e98c34b11bee64", 4124, 4164, 2268, 2448, 44, 1180}, + //offsets for: /mysqlrpm/5.1.68/usr/sbin/mysqld (5.1.68-community) + {"5.1.68-community","df5dc268b36dbe853ed37d91fd4b6b3f", 4124, 4164, 2268, 2448, 44, 1180}, + //offsets for: /mysqlrpm/5.1.69/usr/sbin/mysqld (5.1.69-community) + {"5.1.69-community","4c8acbca31f3f4ba44d35db9f5c65bc0", 4124, 4164, 2268, 2448, 44, 1180}, + //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}, + //offsets for: /mysqlrpm/5.5.23/usr/sbin/mysqld (5.5.23) + {"5.5.23","c94f20f31cfa674d5763da7d2344c219", 3808, 3836, 2360, 2692, 44, 1644}, + //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}, + //offsets for: /mysqlrpm/5.5.27/usr/sbin/mysqld (5.5.27) + {"5.5.27","e6a9760303ea8fdd4face5a88d925059", 3812, 3840, 2364, 2696, 44, 1644}, + //offsets for: /mysqlrpm/5.5.28/usr/sbin/mysqld (5.5.28) + {"5.5.28","8f435a5b9308fd2c4d20860fb3b38ec7", 3812, 3840, 2364, 2696, 44, 1644}, + //offsets for: /mysqlrpm/5.5.29/usr/sbin/mysqld (5.5.29) + {"5.5.29","89c4df6dcf941ccded0c08c73d976877", 3812, 3840, 2364, 2696, 44, 1644}, + //offsets for: /mysqlrpm/5.5.30/usr/sbin/mysqld (5.5.30) + {"5.5.30","0186d1ef4725814924bfe968e3455138", 3816, 3844, 2368, 2700, 44, 1644}, + //offsets for: /mysqlrpm/5.5.31/usr/sbin/mysqld (5.5.31) + {"5.5.31","190e7556e226f8690ba8672869178e4c", 3816, 3844, 2368, 2700, 44, 1644}, + //offsets for: /mysqlrpm/5.6.10/usr/sbin/mysqld (5.6.10) + {"5.6.10","dd3abddcfd0015de81b6a26b6190cefb", 5572, 5600, 2640, 2980, 36, 1712}, + //offsets for: /mysqlrpm/5.6.11/usr/sbin/mysqld (5.6.11) + {"5.6.11","0f716b88d1c11c031dbb206a3e1b31a4", 5572, 5600, 2640, 2980, 36, 1724}, - //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.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.1.65/usr/sbin/mysqld (5.1.65-community) - {"5.1.65-community","0e96922fe95be696f7f91fc5a94c5d46", 4124, 4164, 2268, 2448, 44, 1180}, - //offsets for: /mysqlrpm/5.1.66/usr/sbin/mysqld (5.1.66-community) - {"5.1.66-community","60049b5c82e3479323001ffb28447820", 4124, 4164, 2268, 2448, 44, 1180}, - //offsets for: /mysqlrpm/5.1.67/usr/sbin/mysqld (5.1.67-community) - {"5.1.67-community","2ca1d344c7054644a7e98c34b11bee64", 4124, 4164, 2268, 2448, 44, 1180}, - //offsets for: /mysqlrpm/5.1.68/usr/sbin/mysqld (5.1.68-community) - {"5.1.68-community","df5dc268b36dbe853ed37d91fd4b6b3f", 4124, 4164, 2268, 2448, 44, 1180}, - //offsets for: /mysqlrpm/5.1.69/usr/sbin/mysqld (5.1.69-community) - {"5.1.69-community","4c8acbca31f3f4ba44d35db9f5c65bc0", 4124, 4164, 2268, 2448, 44, 1180}, - - //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}, - //offsets for: /mysqlrpm/5.5.23/usr/sbin/mysqld (5.5.23) - {"5.5.23","c94f20f31cfa674d5763da7d2344c219", 3808, 3836, 2360, 2692, 44, 1644}, - //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}, - //offsets for: /mysqlrpm/5.5.27/usr/sbin/mysqld (5.5.27) - {"5.5.27","e6a9760303ea8fdd4face5a88d925059", 3812, 3840, 2364, 2696, 44, 1644}, - //offsets for: /mysqlrpm/5.5.28/usr/sbin/mysqld (5.5.28) - {"5.5.28","8f435a5b9308fd2c4d20860fb3b38ec7", 3812, 3840, 2364, 2696, 44, 1644}, - //offsets for: /mysqlrpm/5.5.29/usr/sbin/mysqld (5.5.29) - {"5.5.29","89c4df6dcf941ccded0c08c73d976877", 3812, 3840, 2364, 2696, 44, 1644}, - //offsets for: /mysqlrpm/5.5.30/usr/sbin/mysqld (5.5.30) - {"5.5.30","0186d1ef4725814924bfe968e3455138", 3816, 3844, 2368, 2700, 44, 1644}, - //offsets for: /mysqlrpm/5.5.31/usr/sbin/mysqld (5.5.31) - {"5.5.31","190e7556e226f8690ba8672869178e4c", 3816, 3844, 2368, 2700, 44, 1644}, - - //offsets for: /mysqlrpm/5.6.10/usr/sbin/mysqld (5.6.10) - {"5.6.10","dd3abddcfd0015de81b6a26b6190cefb", 5572, 5600, 2640, 2980, 36, 1712}, - //offsets for: /mysqlrpm/5.6.11/usr/sbin/mysqld (5.6.11) - {"5.6.11","0f716b88d1c11c031dbb206a3e1b31a4", 5572, 5600, 2640, 2980, 36, 1724}, - - //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) - {"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) - {"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: /mysql/5.1.65/bin/mysqld (5.1.65) - {"5.1.65","96c750de824898f8af435bd7b73a5e88", 4140, 4180, 2284, 2464, 44, 1180}, - //offsets for: /mysql/5.1.66/bin/mysqld (5.1.66) - {"5.1.66","db5aea9077c989e079980960405807bc", 4140, 4180, 2284, 2464, 44, 1180}, - //offsets for: /mysql/5.1.67/bin/mysqld (5.1.67) - {"5.1.67","9f2609f5925abe6f3c01a05a53569b35", 4140, 4180, 2284, 2464, 44, 1180}, - //offsets for: /mysql/5.1.68/bin/mysqld (5.1.68) - {"5.1.68","d03c42d8a8946f11ace86a5e1189114d", 4140, 4180, 2284, 2464, 44, 1180}, - //offsets for: /mysql/5.1.69/bin/mysqld (5.1.69) - {"5.1.69","5abf5a9f9f9c01be997595b066a40986", 4140, 4180, 2284, 2464, 44, 1180}, - - //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) - {"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) - {"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}, - //offsets for: /mysql-5.5_5.5.22-0ubuntu1_i386/bin/mysqld (5.5.22-0ubuntu1) - {"5.5.22-0ubuntu1","9cc7d4582b1fae0ebf43dbe5ffb56008", 3784, 3812, 2336, 2668, 44, 1640}, - //offsets for: /mysql/5.5.23/bin/mysqld (5.5.23) - {"5.5.23","8f51987d3f0d0dc044adcf42937050f6", 3808, 3836, 2360, 2692, 44, 1644}, - //offsets for: /mysql/5.5.24/bin/mysqld (5.5.24) - {"5.5.24","a3916dca234905bd49b3fefe5d6ad738", 3808, 3836, 2360, 2692, 44, 1644}, - //offsets for: /mysql/5.5.25/bin/mysqld (5.5.25) - {"5.5.25","f16c3fa53f77e5f25fd25694b5a27c48", 3812, 3840, 2364, 2696, 44, 1644}, - //offsets for: /mysql/5.5.27/bin/mysqld (5.5.27) - {"5.5.27","b4d8ccf9348ecfe52fcf1d34b37a394d", 3812, 3840, 2364, 2696, 44, 1644}, - //offsets for: /mysql/5.5.28/bin/mysqld (5.5.28) - {"5.5.28","f8922e4289a17acf0347e478f6f30705", 3812, 3840, 2364, 2696, 44, 1644}, - //offsets for: /mysql/5.5.29/bin/mysqld (5.5.29) - {"5.5.29","e94a673a244449de87e6a489a7a08acb", 3812, 3840, 2364, 2696, 44, 1644}, - //offsets for: /mysql/5.5.30/bin/mysqld (5.5.30) - {"5.5.30","c7b98be45d35b77da6679c354c23d1fa", 3816, 3844, 2368, 2700, 44, 1644}, - //offsets for: /mysql/5.5.31/bin/mysqld (5.5.31) - {"5.5.31","36631a7c748358598ba21cd4157545d9", 3816, 3844, 2368, 2700, 44, 1644}, - - //offsets for: /mysql/5.6.10/bin/mysqld (5.6.10) - {"5.6.10","84600f18354f519e38302c04fe55ed9c", 5572, 5600, 2640, 2980, 36, 1712}, - //offsets for: /mysql/5.6.11/bin/mysqld (5.6.11) - {"5.6.11","72e67111f3c1d1c1d4e7095e3a004fcf", 5572, 5600, 2640, 2980, 36, 1724}, - - //offsets for: /mysqlrpm/5.1.70/usr/sbin/mysqld (5.1.70-community) - {"5.1.70-community","605c76c9d37a890cea85c075aeaaa2e6", 4124, 4164, 2268, 2448, 44, 1188}, - //offsets for: /mysqlrpm/5.5.32/usr/sbin/mysqld (5.5.32) - {"5.5.32","3c00829c6ef3286598079b9f49de9843", 3816, 3844, 2368, 2700, 44, 1656}, - //offsets for: /mysqlrpm/5.6.12/usr/sbin/mysqld (5.6.12) - {"5.6.12","edaf494ffda685fb4b03b3d9366f6af6", 5580, 5608, 2640, 2980, 36, 1732}, - //offsets for: /mysql/5.1.70/bin/mysqld (5.1.70) - {"5.1.70","f1c06fde306a5cd5b195425c18c4351b", 4140, 4180, 2284, 2464, 44, 1188}, - //offsets for: /mysql/5.5.32/bin/mysqld (5.5.32) - {"5.5.32","85199d7a643bf0c336385f613b007018", 3816, 3844, 2368, 2700, 44, 1656}, - //offsets for: /mysql/5.6.12/bin/mysqld (5.6.12) - {"5.6.12","469ed6bc745eea0d47a69ecf7b3e0d56", 5580, 5608, 2640, 2980, 36, 1732}, - //offsets for: /mysqlrpm/5.1.71/usr/sbin/mysqld (5.1.71-community) - {"5.1.71-community","2039eb1fb90b85d3744e3628b3ab35fa", 4124, 4164, 2268, 2448, 44, 1188}, - //offsets for: /mysqlrpm/5.5.33/usr/sbin/mysqld (5.5.33) - {"5.5.33","403fe8f9ecd935890f7ebc73297a08bb", 3816, 3844, 2368, 2700, 44, 1656}, - //offsets for: /mysqlrpm/5.6.13/usr/sbin/mysqld (5.6.13) - {"5.6.13","8ac0185b8f8a2a066ed0f5cd45597d6b", 5580, 5608, 2640, 2980, 36, 1732}, - //offsets for: /mysql/5.1.71/bin/mysqld (5.1.71) - {"5.1.71","5e9120167eae0138de4e6f307f337383", 4140, 4180, 2284, 2464, 44, 1188}, - //offsets for: /mysql/5.5.33/bin/mysqld (5.5.33) - {"5.5.33","3172729c5bf6e81c8d87fe26fe248204", 3816, 3844, 2368, 2700, 44, 1656}, - //offsets for: /mysql/5.6.13/bin/mysqld (5.6.13) - {"5.6.13","f25a8fabbb1d205f0f2d772d7f41b9da", 5580, 5608, 2640, 2980, 36, 1732}, - //offsets for: /mysqlrpm/5.5.34/usr/sbin/mysqld (5.5.34) - {"5.5.34","fc8bc7c4edd6c115be5f941ca4618f63", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64}, - //offsets for: /mysqlrpm/5.6.14/usr/sbin/mysqld (5.6.14) - {"5.6.14","d7444b6db9d1a5aceb2162e77de762dc", 5632, 5660, 2640, 3028, 36, 1744, 60, 0, 20, 64}, - //offsets for: /mysqlrpm/5.1.72/usr/sbin/mysqld (5.1.72-community) - {"5.1.72-community","3f7221660b8c9e953f327da95d250597", 4128, 4168, 2268, 2448, 44, 1188, 4, 0, 12, 8}, - //offsets for: /mysql/5.1.72/bin/mysqld (5.1.72) - {"5.1.72","199d47e26e5a4cc29399724f47c30aca", 4144, 4184, 2284, 2464, 44, 1188, 4, 0, 12, 8}, - //offsets for: /mysqlrpm/5.1.73/usr/sbin/mysqld (5.1.73-community) - {"5.1.73-community","3ecceab3ca6a816f5744a9437208e5a3", 4128, 4168, 2268, 2448, 44, 1188, 4, 0, 12, 8}, - //offsets for: /mysqlrpm/5.5.35/usr/sbin/mysqld (5.5.35) - {"5.5.35","7cd5543273a70209e746b6df7d4b5406", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64}, - //offsets for: /mysqlrpm/5.6.15/usr/sbin/mysqld (5.6.15) - {"5.6.15","59683562fb382b2ab43394517802595e", 5648, 5676, 2652, 3044, 36, 1748, 60, 0, 20, 64}, - //offsets for: /mysql/5.1.73/bin/mysqld (5.1.73) - {"5.1.73","6a9357091496248e25387f9c2c0c75c4", 4144, 4184, 2284, 2464, 44, 1188, 4, 0, 12, 8}, - //offsets for: /mysqlrpm/5.5.36/usr/sbin/mysqld (5.5.36) - {"5.5.36","361590c58e15541246b6d3dbc46011da", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64}, - //offsets for: /mysqlrpm/5.6.16/usr/sbin/mysqld (5.6.16) - {"5.6.16","5a570b87913b8d028dfdfca3fc82bd19", 5648, 5676, 2652, 3044, 36, 1748, 60, 0, 20, 64}, - //offsets for: /mysql/5.5.36/bin/mysqld (5.5.36) - {"5.5.36","22663b7989f3c24619493ac414cbca38", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64}, - //offsets for: /mysql/5.6.16/bin/mysqld (5.6.16) - {"5.6.16","7019959ebb4adaff1047aa4dfb1ff688", 5648, 5676, 2652, 3044, 36, 1748, 60, 0, 20, 64}, - //offsets for: /mysqlrpm/5.6.17/usr/sbin/mysqld (5.6.17) - {"5.6.17","c2a9a665cb88d59b21d85236c963a814", 5652, 5680, 2656, 3048, 36, 1748, 60, 0, 20, 64}, - //offsets for: /mysql/5.6.17/bin/mysqld (5.6.17) - {"5.6.17","fc472182fa82c4e6a2e84fa3e6550bc9", 5652, 5680, 2656, 3048, 36, 1748, 60, 0, 20, 64}, - //offsets for: /mysqlrpm/5.5.37/usr/sbin/mysqld (5.5.37) - {"5.5.37","4f7f6578b33b23ae04aa5c8b13a335dc", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64} + //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) + {"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) + {"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: /mysql/5.1.65/bin/mysqld (5.1.65) + {"5.1.65","96c750de824898f8af435bd7b73a5e88", 4140, 4180, 2284, 2464, 44, 1180}, + //offsets for: /mysql/5.1.66/bin/mysqld (5.1.66) + {"5.1.66","db5aea9077c989e079980960405807bc", 4140, 4180, 2284, 2464, 44, 1180}, + //offsets for: /mysql/5.1.67/bin/mysqld (5.1.67) + {"5.1.67","9f2609f5925abe6f3c01a05a53569b35", 4140, 4180, 2284, 2464, 44, 1180}, + //offsets for: /mysql/5.1.68/bin/mysqld (5.1.68) + {"5.1.68","d03c42d8a8946f11ace86a5e1189114d", 4140, 4180, 2284, 2464, 44, 1180}, + //offsets for: /mysql/5.1.69/bin/mysqld (5.1.69) + {"5.1.69","5abf5a9f9f9c01be997595b066a40986", 4140, 4180, 2284, 2464, 44, 1180}, + //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) + {"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) + {"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}, + //offsets for: /mysql-5.5_5.5.22-0ubuntu1_i386/bin/mysqld (5.5.22-0ubuntu1) + {"5.5.22-0ubuntu1","9cc7d4582b1fae0ebf43dbe5ffb56008", 3784, 3812, 2336, 2668, 44, 1640}, + //offsets for: /mysql/5.5.23/bin/mysqld (5.5.23) + {"5.5.23","8f51987d3f0d0dc044adcf42937050f6", 3808, 3836, 2360, 2692, 44, 1644}, + //offsets for: /mysql/5.5.24/bin/mysqld (5.5.24) + {"5.5.24","a3916dca234905bd49b3fefe5d6ad738", 3808, 3836, 2360, 2692, 44, 1644}, + //offsets for: /mysql/5.5.25/bin/mysqld (5.5.25) + {"5.5.25","f16c3fa53f77e5f25fd25694b5a27c48", 3812, 3840, 2364, 2696, 44, 1644}, + //offsets for: /mysql/5.5.27/bin/mysqld (5.5.27) + {"5.5.27","b4d8ccf9348ecfe52fcf1d34b37a394d", 3812, 3840, 2364, 2696, 44, 1644}, + //offsets for: /mysql/5.5.28/bin/mysqld (5.5.28) + {"5.5.28","f8922e4289a17acf0347e478f6f30705", 3812, 3840, 2364, 2696, 44, 1644}, + //offsets for: /mysql/5.5.29/bin/mysqld (5.5.29) + {"5.5.29","e94a673a244449de87e6a489a7a08acb", 3812, 3840, 2364, 2696, 44, 1644}, + //offsets for: /mysql/5.5.30/bin/mysqld (5.5.30) + {"5.5.30","c7b98be45d35b77da6679c354c23d1fa", 3816, 3844, 2368, 2700, 44, 1644}, + //offsets for: /mysql/5.5.31/bin/mysqld (5.5.31) + {"5.5.31","36631a7c748358598ba21cd4157545d9", 3816, 3844, 2368, 2700, 44, 1644}, + //offsets for: /mysql/5.6.10/bin/mysqld (5.6.10) + {"5.6.10","84600f18354f519e38302c04fe55ed9c", 5572, 5600, 2640, 2980, 36, 1712}, + //offsets for: /mysql/5.6.11/bin/mysqld (5.6.11) + {"5.6.11","72e67111f3c1d1c1d4e7095e3a004fcf", 5572, 5600, 2640, 2980, 36, 1724}, + //offsets for: /mysqlrpm/5.1.70/usr/sbin/mysqld (5.1.70-community) + {"5.1.70-community","605c76c9d37a890cea85c075aeaaa2e6", 4124, 4164, 2268, 2448, 44, 1188}, + //offsets for: /mysqlrpm/5.5.32/usr/sbin/mysqld (5.5.32) + {"5.5.32","3c00829c6ef3286598079b9f49de9843", 3816, 3844, 2368, 2700, 44, 1656}, + //offsets for: /mysqlrpm/5.6.12/usr/sbin/mysqld (5.6.12) + {"5.6.12","edaf494ffda685fb4b03b3d9366f6af6", 5580, 5608, 2640, 2980, 36, 1732}, + //offsets for: /mysql/5.1.70/bin/mysqld (5.1.70) + {"5.1.70","f1c06fde306a5cd5b195425c18c4351b", 4140, 4180, 2284, 2464, 44, 1188}, + //offsets for: /mysql/5.5.32/bin/mysqld (5.5.32) + {"5.5.32","85199d7a643bf0c336385f613b007018", 3816, 3844, 2368, 2700, 44, 1656}, + //offsets for: /mysql/5.6.12/bin/mysqld (5.6.12) + {"5.6.12","469ed6bc745eea0d47a69ecf7b3e0d56", 5580, 5608, 2640, 2980, 36, 1732}, + //offsets for: /mysqlrpm/5.1.71/usr/sbin/mysqld (5.1.71-community) + {"5.1.71-community","2039eb1fb90b85d3744e3628b3ab35fa", 4124, 4164, 2268, 2448, 44, 1188}, + //offsets for: /mysqlrpm/5.5.33/usr/sbin/mysqld (5.5.33) + {"5.5.33","403fe8f9ecd935890f7ebc73297a08bb", 3816, 3844, 2368, 2700, 44, 1656}, + //offsets for: /mysqlrpm/5.6.13/usr/sbin/mysqld (5.6.13) + {"5.6.13","8ac0185b8f8a2a066ed0f5cd45597d6b", 5580, 5608, 2640, 2980, 36, 1732}, + //offsets for: /mysql/5.1.71/bin/mysqld (5.1.71) + {"5.1.71","5e9120167eae0138de4e6f307f337383", 4140, 4180, 2284, 2464, 44, 1188}, + //offsets for: /mysql/5.5.33/bin/mysqld (5.5.33) + {"5.5.33","3172729c5bf6e81c8d87fe26fe248204", 3816, 3844, 2368, 2700, 44, 1656}, + //offsets for: /mysql/5.6.13/bin/mysqld (5.6.13) + {"5.6.13","f25a8fabbb1d205f0f2d772d7f41b9da", 5580, 5608, 2640, 2980, 36, 1732}, + //offsets for: /mysqlrpm/5.5.34/usr/sbin/mysqld (5.5.34) + {"5.5.34","fc8bc7c4edd6c115be5f941ca4618f63", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64}, + //offsets for: /mysqlrpm/5.6.14/usr/sbin/mysqld (5.6.14) + {"5.6.14","d7444b6db9d1a5aceb2162e77de762dc", 5632, 5660, 2640, 3028, 36, 1744, 60, 0, 20, 64}, + //offsets for: /mysqlrpm/5.1.72/usr/sbin/mysqld (5.1.72-community) + {"5.1.72-community","3f7221660b8c9e953f327da95d250597", 4128, 4168, 2268, 2448, 44, 1188, 4, 0, 12, 8}, + //offsets for: /mysql/5.1.72/bin/mysqld (5.1.72) + {"5.1.72","199d47e26e5a4cc29399724f47c30aca", 4144, 4184, 2284, 2464, 44, 1188, 4, 0, 12, 8}, + //offsets for: /mysqlrpm/5.1.73/usr/sbin/mysqld (5.1.73-community) + {"5.1.73-community","3ecceab3ca6a816f5744a9437208e5a3", 4128, 4168, 2268, 2448, 44, 1188, 4, 0, 12, 8}, + //offsets for: /mysqlrpm/5.5.35/usr/sbin/mysqld (5.5.35) + {"5.5.35","7cd5543273a70209e746b6df7d4b5406", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64}, + //offsets for: /mysqlrpm/5.6.15/usr/sbin/mysqld (5.6.15) + {"5.6.15","59683562fb382b2ab43394517802595e", 5648, 5676, 2652, 3044, 36, 1748, 60, 0, 20, 64}, + //offsets for: /mysql/5.1.73/bin/mysqld (5.1.73) + {"5.1.73","6a9357091496248e25387f9c2c0c75c4", 4144, 4184, 2284, 2464, 44, 1188, 4, 0, 12, 8}, + //offsets for: /mysqlrpm/5.5.36/usr/sbin/mysqld (5.5.36) + {"5.5.36","361590c58e15541246b6d3dbc46011da", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64}, + //offsets for: /mysqlrpm/5.6.16/usr/sbin/mysqld (5.6.16) + {"5.6.16","5a570b87913b8d028dfdfca3fc82bd19", 5648, 5676, 2652, 3044, 36, 1748, 60, 0, 20, 64}, + //offsets for: /mysql/5.5.36/bin/mysqld (5.5.36) + {"5.5.36","22663b7989f3c24619493ac414cbca38", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64}, + //offsets for: /mysql/5.6.16/bin/mysqld (5.6.16) + {"5.6.16","7019959ebb4adaff1047aa4dfb1ff688", 5648, 5676, 2652, 3044, 36, 1748, 60, 0, 20, 64}, + //offsets for: /mysqlrpm/5.6.17/usr/sbin/mysqld (5.6.17) + {"5.6.17","c2a9a665cb88d59b21d85236c963a814", 5652, 5680, 2656, 3048, 36, 1748, 60, 0, 20, 64}, + //offsets for: /mysql/5.6.17/bin/mysqld (5.6.17) + {"5.6.17","fc472182fa82c4e6a2e84fa3e6550bc9", 5652, 5680, 2656, 3048, 36, 1748, 60, 0, 20, 64}, + //offsets for: /mysqlrpm/5.5.37/usr/sbin/mysqld (5.5.37) + {"5.5.37","4f7f6578b33b23ae04aa5c8b13a335dc", 3868, 3896, 2368, 2748, 44, 1656, 60, 0, 20, 64} }; #endif - #else //start offsets for MariaDB #ifdef __x86_64__ @@ -820,180 +807,184 @@ const ThdOffsets thd_offsets_arr[] = const ThdOffsets thd_offsets_arr[] = { /* +++ MARIADB 64 OFFSETS GO HERE +++ */ + //offsets for: /mariadb/10.1.13/bin/mysqld (10.1.13-MariaDB) + {"10.1.13-MariaDB","cd322698dcd46dd82770dc091f1eec51", 13592, 13656, 6368, 7976, 88, 2976, 8, 0, 16, 24, 152, 13748}, //offsets for: /mariadb/10.1.12/bin/mysqld (10.1.12-MariaDB) {"10.1.12-MariaDB","e2ba726e2e6f56976518581da0a2c443", 13592, 13656, 6368, 7976, 88, 2976, 8, 0, 16, 24, 152, 13748}, - //offsets for: /mariadb/10.0.24/bin/mysqld (10.0.24-MariaDB) - {"10.0.24-MariaDB","f757c1ee447cf82766b7b6d776beadc0", 13432, 13496, 6208, 7816, 88, 2976, 8, 0, 16, 24, 152, 13588}, - //offsets for: /mariadb/5.5.48/bin/mysqld (5.5.48-MariaDB) - {"5.5.48-MariaDB","fe4ddddc2591703dfdb5f66075ee4751", 12032, 12096, 5800, 6904, 88, 2920, 8, 0, 16, 24, 152, 12168}, - //offsets for: /mariadb/10.1.11/bin/mysqld (10.1.11-MariaDB) - {"10.1.11-MariaDB","91dc9f2e78433f0efc975174263a4206", 13592, 13656, 6368, 7976, 88, 2976, 8, 0, 16, 24, 152, 13748}, - //offsets for: /mariadb/10.1.10/bin/mysqld (10.1.10-MariaDB) - {"10.1.10-MariaDB","d6dd898de1ac04fc742bf525f8ce37bf", 13576, 13640, 6352, 7960, 88, 2960, 8, 0, 16, 24, 152, 13732}, - //offsets for: /mariadb/10.0.23/bin/mysqld (10.0.23-MariaDB) - {"10.0.23-MariaDB","1cc0611b29e35a3a64eba2ff9bc3663c", 13416, 13480, 6192, 7800, 88, 2976, 8, 0, 16, 24, 152, 13572}, - //offsets for: /mariadb/10.0.22/bin/mysqld (10.0.22-MariaDB) - {"10.0.22-MariaDB","271759a346ed0b973c1b3570eb6e70bc", 13416, 13480, 6192, 7800, 88, 2976, 8, 0, 16, 24, 152, 13572}, - //offsets for: /mariadb/5.5.47/bin/mysqld (5.5.47-MariaDB) - {"5.5.47-MariaDB","642990798709d79dcdc662104805b44b", 12032, 12096, 5800, 6904, 88, 2920, 8, 0, 16, 24, 152, 12168}, - //offsets for: /mariadb/10.1.9/bin/mysqld (10.1.9-MariaDB) - {"10.1.9-MariaDB","f6a488fd8331d6201c0598fb6ff3fa9e", 13576, 13640, 6352, 7960, 88, 2960, 8, 0, 16, 24, 152, 13732}, - //offsets for: /mariadb/10.1.8/bin/mysqld (10.1.8-MariaDB) - {"10.1.8-MariaDB","cf103655e354afa2bf43cc4899b65101", 13576, 13640, 6352, 7960, 88, 2960, 8, 0, 16, 24, 152, 13732}, - //offsets for: /mariadb/5.5.46/bin/mysqld (5.5.46-MariaDB) - {"5.5.46-MariaDB","ec8c941f31086bed6cf9c7e97ed61c0a", 12032, 12096, 5800, 6904, 88, 2920, 8, 0, 16, 24, 152, 12168}, - //offsets for: /mariadb/10.0.21/bin/mysqld (10.0.21-MariaDB) - {"10.0.21-MariaDB","e565b3971cc11516822e676465d5b4a9", 13416, 13480, 6192, 7800, 88, 2976, 8, 0, 16, 24, 152, 13572}, - //offsets for: /mariadb/5.5.45/bin/mysqld (5.5.45-MariaDB) - {"5.5.45-MariaDB","70faaed59f9d41cfea9510dbdaa8cb0d", 12032, 12096, 5800, 6904, 88, 2920, 8, 0, 16, 24, 152, 12168}, - //offsets for: /mariadb/10.0.20/bin/mysqld (10.0.20-MariaDB) - {"10.0.20-MariaDB","1fd5e15156937feb7f4c5fd1164dd029", 13408, 13472, 6192, 7792, 88, 3000, 8, 0, 16, 24, 152, 13564}, - //offsets for: /mariadb/5.5.44/bin/mysqld (5.5.44-MariaDB) - {"5.5.44-MariaDB","d4a60362e7a50edca299cfd7d4b6f6b8", 12016, 12080, 5800, 6896, 88, 2944, 8, 0, 16, 24, 152, 12152}, - //offsets for: /mariadb/10.0.19/bin/mysqld (10.0.19-MariaDB) - {"10.0.19-MariaDB","c0e7e8c4396c7e59a2cbbecdd3c6435e", 13408, 13472, 6192, 7792, 88, 3000, 8, 0, 16, 24, 152, 13564}, - //offsets for: /mariadb/10.0.18/bin/mysqld (10.0.18-MariaDB) - {"10.0.18-MariaDB","94ad1b6c2323272ec77ce4aca37ef4e3", 13408, 13472, 6192, 7792, 88, 3000, 8, 0, 16, 24, 152, 13564}, - //offsets for: /mariadb/5.5.43/bin/mysqld (5.5.43-MariaDB) - {"5.5.43-MariaDB","eedfc38ad498ea35e3c6ab4a47ad769e", 12016, 12080, 5800, 6896, 88, 2944, 8, 0, 16, 24, 152, 12152}, - //offsets for: /mariadb/10.0.17/bin/mysqld (10.0.17-MariaDB) - {"10.0.17-MariaDB","080d431c04b2d0c7dff5ca5c5f760b18", 14368, 14432, 6192, 7792, 88, 3000, 8, 0, 16, 24, 152, 14524}, - //offsets for: /mariadb/5.5.42/bin/mysqld (5.5.42-MariaDB) - {"5.5.42-MariaDB","04b7fbb6804ca8961fa8b4308a66a7c8", 12016, 12080, 5800, 6896, 88, 2944, 8, 0, 16, 24, 152, 12152}, - //offsets for: /mariadb/10.0.16/bin/mysqld (10.0.16-MariaDB) - {"10.0.16-MariaDB","c8cc8c9c5e1a1fb33bb2555d27b076a8", 14368, 14432, 6192, 7792, 88, 3000, 8, 0, 16, 24, 152, 14524}, - //offsets for: /mariadb/5.5.41/bin/mysqld (5.5.41-MariaDB) - {"5.5.41-MariaDB","2073691580d80e2760a7e9d89aa93736", 12016, 12080, 5800, 6896, 88, 2936, 8, 0, 16, 24}, - //offsets for: /mariadb/10.0.15/bin/mysqld (10.0.15-MariaDB) - {"10.0.15-MariaDB","a7d7f8d53605449629f565baeeb15ef1", 14368, 14432, 6192, 7792, 88, 2992, 8, 0, 16, 24}, + //offsets for: /mariadb/10.0.24/bin/mysqld (10.0.24-MariaDB) + {"10.0.24-MariaDB","f757c1ee447cf82766b7b6d776beadc0", 13432, 13496, 6208, 7816, 88, 2976, 8, 0, 16, 24, 152, 13588}, + //offsets for: /mariadb/5.5.48/bin/mysqld (5.5.48-MariaDB) + {"5.5.48-MariaDB","fe4ddddc2591703dfdb5f66075ee4751", 12032, 12096, 5800, 6904, 88, 2920, 8, 0, 16, 24, 152, 12168}, + //offsets for: /mariadb/10.1.11/bin/mysqld (10.1.11-MariaDB) + {"10.1.11-MariaDB","91dc9f2e78433f0efc975174263a4206", 13592, 13656, 6368, 7976, 88, 2976, 8, 0, 16, 24, 152, 13748}, + //offsets for: /mariadb/10.1.10/bin/mysqld (10.1.10-MariaDB) + {"10.1.10-MariaDB","d6dd898de1ac04fc742bf525f8ce37bf", 13576, 13640, 6352, 7960, 88, 2960, 8, 0, 16, 24, 152, 13732}, + //offsets for: /mariadb/10.0.23/bin/mysqld (10.0.23-MariaDB) + {"10.0.23-MariaDB","1cc0611b29e35a3a64eba2ff9bc3663c", 13416, 13480, 6192, 7800, 88, 2976, 8, 0, 16, 24, 152, 13572}, + //offsets for: /mariadb/10.0.22/bin/mysqld (10.0.22-MariaDB) + {"10.0.22-MariaDB","271759a346ed0b973c1b3570eb6e70bc", 13416, 13480, 6192, 7800, 88, 2976, 8, 0, 16, 24, 152, 13572}, + //offsets for: /mariadb/5.5.47/bin/mysqld (5.5.47-MariaDB) + {"5.5.47-MariaDB","642990798709d79dcdc662104805b44b", 12032, 12096, 5800, 6904, 88, 2920, 8, 0, 16, 24, 152, 12168}, + //offsets for: /mariadb/10.1.9/bin/mysqld (10.1.9-MariaDB) + {"10.1.9-MariaDB","f6a488fd8331d6201c0598fb6ff3fa9e", 13576, 13640, 6352, 7960, 88, 2960, 8, 0, 16, 24, 152, 13732}, + //offsets for: /mariadb/10.1.8/bin/mysqld (10.1.8-MariaDB) + {"10.1.8-MariaDB","cf103655e354afa2bf43cc4899b65101", 13576, 13640, 6352, 7960, 88, 2960, 8, 0, 16, 24, 152, 13732}, + //offsets for: /mariadb/5.5.46/bin/mysqld (5.5.46-MariaDB) + {"5.5.46-MariaDB","ec8c941f31086bed6cf9c7e97ed61c0a", 12032, 12096, 5800, 6904, 88, 2920, 8, 0, 16, 24, 152, 12168}, + //offsets for: /mariadb/10.0.21/bin/mysqld (10.0.21-MariaDB) + {"10.0.21-MariaDB","e565b3971cc11516822e676465d5b4a9", 13416, 13480, 6192, 7800, 88, 2976, 8, 0, 16, 24, 152, 13572}, + //offsets for: /mariadb/5.5.45/bin/mysqld (5.5.45-MariaDB) + {"5.5.45-MariaDB","70faaed59f9d41cfea9510dbdaa8cb0d", 12032, 12096, 5800, 6904, 88, 2920, 8, 0, 16, 24, 152, 12168}, + //offsets for: /mariadb/10.0.20/bin/mysqld (10.0.20-MariaDB) + {"10.0.20-MariaDB","1fd5e15156937feb7f4c5fd1164dd029", 13408, 13472, 6192, 7792, 88, 3000, 8, 0, 16, 24, 152, 13564}, + //offsets for: /mariadb/5.5.44/bin/mysqld (5.5.44-MariaDB) + {"5.5.44-MariaDB","d4a60362e7a50edca299cfd7d4b6f6b8", 12016, 12080, 5800, 6896, 88, 2944, 8, 0, 16, 24, 152, 12152}, + //offsets for: /mariadb/10.0.19/bin/mysqld (10.0.19-MariaDB) + {"10.0.19-MariaDB","c0e7e8c4396c7e59a2cbbecdd3c6435e", 13408, 13472, 6192, 7792, 88, 3000, 8, 0, 16, 24, 152, 13564}, + //offsets for: /mariadb/10.0.18/bin/mysqld (10.0.18-MariaDB) + {"10.0.18-MariaDB","94ad1b6c2323272ec77ce4aca37ef4e3", 13408, 13472, 6192, 7792, 88, 3000, 8, 0, 16, 24, 152, 13564}, + //offsets for: /mariadb/5.5.43/bin/mysqld (5.5.43-MariaDB) + {"5.5.43-MariaDB","eedfc38ad498ea35e3c6ab4a47ad769e", 12016, 12080, 5800, 6896, 88, 2944, 8, 0, 16, 24, 152, 12152}, + //offsets for: /mariadb/10.0.17/bin/mysqld (10.0.17-MariaDB) + {"10.0.17-MariaDB","080d431c04b2d0c7dff5ca5c5f760b18", 14368, 14432, 6192, 7792, 88, 3000, 8, 0, 16, 24, 152, 14524}, + //offsets for: /mariadb/5.5.42/bin/mysqld (5.5.42-MariaDB) + {"5.5.42-MariaDB","04b7fbb6804ca8961fa8b4308a66a7c8", 12016, 12080, 5800, 6896, 88, 2944, 8, 0, 16, 24, 152, 12152}, + //offsets for: /mariadb/10.0.16/bin/mysqld (10.0.16-MariaDB) + {"10.0.16-MariaDB","c8cc8c9c5e1a1fb33bb2555d27b076a8", 14368, 14432, 6192, 7792, 88, 3000, 8, 0, 16, 24, 152, 14524}, + //offsets for: /mariadb/5.5.41/bin/mysqld (5.5.41-MariaDB) + {"5.5.41-MariaDB","2073691580d80e2760a7e9d89aa93736", 12016, 12080, 5800, 6896, 88, 2936, 8, 0, 16, 24}, + //offsets for: /mariadb/10.0.15/bin/mysqld (10.0.15-MariaDB) + {"10.0.15-MariaDB","a7d7f8d53605449629f565baeeb15ef1", 14368, 14432, 6192, 7792, 88, 2992, 8, 0, 16, 24}, //offsets for: bin/mysqld (10.0.14-MariaDB) {"10.0.14-MariaDB","715a7512a2d5e9cf8722f033ac39abc2", 14368, 14432, 6192, 7792, 88, 2992, 8, 0, 16, 24}, - //offsets for: /mariadb/10.0.10/bin/mysqld (10.0.10-MariaDB) + //offsets for: /mariadb/10.0.10/bin/mysqld (10.0.10-MariaDB) {"10.0.10-MariaDB","95b0ecd856e2c5012b03ff0ce292cf05", 14368, 14432, 6184, 7784, 88, 2992, 8, 0, 16, 24}, - //offsets for: /mariadb/10.0.11/bin/mysqld (10.0.11-MariaDB) + //offsets for: /mariadb/10.0.11/bin/mysqld (10.0.11-MariaDB) {"10.0.11-MariaDB","64eb81f7a969b9351e9a7d5e4fa6161c", 14360, 14424, 6176, 7776, 88, 2992, 8, 0, 16, 24}, - //offsets for: /mariadb/10.0.12/bin/mysqld (10.0.12-MariaDB) + //offsets for: /mariadb/10.0.12/bin/mysqld (10.0.12-MariaDB) {"10.0.12-MariaDB","f7a6ea88f64bcfaed3d760a315260c40", 14360, 14424, 6176, 7776, 88, 2992, 8, 0, 16, 24}, - //offsets for: /mariadb/10.0.13/bin/mysqld (10.0.13-MariaDB) + //offsets for: /mariadb/10.0.13/bin/mysqld (10.0.13-MariaDB) {"10.0.13-MariaDB","d4825fb8c13ecafce584e79ec184de26", 14368, 14432, 6192, 7792, 88, 2992, 8, 0, 16, 24}, - //offsets for: /mariadb/10.0.6/bin/mysqld (10.0.6-MariaDB) + //offsets for: /mariadb/10.0.6/bin/mysqld (10.0.6-MariaDB) {"10.0.6-MariaDB","cb446cf1c5e534308a972cc3369c444e", 14320, 14384, 6152, 7736, 88, 2968, 8, 0, 16, 24}, - //offsets for: /mariadb/10.0.7/bin/mysqld (10.0.7-MariaDB) + //offsets for: /mariadb/10.0.7/bin/mysqld (10.0.7-MariaDB) {"10.0.7-MariaDB","5d3366439bc89ea4abec51567f3f27ae", 14320, 14384, 6152, 7736, 88, 2968, 8, 0, 16, 24}, - //offsets for: /mariadb/10.0.8/bin/mysqld (10.0.8-MariaDB) + //offsets for: /mariadb/10.0.8/bin/mysqld (10.0.8-MariaDB) {"10.0.8-MariaDB","b5c469a42ab87ee2e5df4c3732b7f329", 14328, 14392, 6160, 7744, 88, 2976, 8, 0, 16, 24}, - //offsets for: /mariadb/10.0.9/bin/mysqld (10.0.9-MariaDB) + //offsets for: /mariadb/10.0.9/bin/mysqld (10.0.9-MariaDB) {"10.0.9-MariaDB","267d6b848a6b77f8341ba78b975084ff", 14368, 14432, 6184, 7784, 88, 2992, 8, 0, 16, 24}, - //offsets for: /mariadb/5.5.40/bin/mysqld (5.5.40-MariaDB) + //offsets for: /mariadb/5.5.40/bin/mysqld (5.5.40-MariaDB) {"5.5.40-MariaDB","d01682f6cec8aa861a9b357a88e5f28a", 12016, 12080, 5800, 6896, 88, 2936, 8, 0, 16, 24}, - //offsets for: /mariadb/5.5.39/bin/mysqld (5.5.39-MariaDB) + //offsets for: /mariadb/5.5.39/bin/mysqld (5.5.39-MariaDB) {"5.5.39-MariaDB","5da9ef52435a920cdcbfe824534a77fc", 12016, 12080, 5800, 6896, 88, 2936, 8, 0, 16, 24}, - //offsets for: /mariadb/5.5.38/bin/mysqld (5.5.38-MariaDB) + //offsets for: /mariadb/5.5.38/bin/mysqld (5.5.38-MariaDB) {"5.5.38-MariaDB","1ecd82e172b1bf62cab9268d48e4e070", 12016, 12080, 5800, 6896, 88, 2936, 8, 0, 16, 24}, - //offsets for: /mariadb/5.5.32/bin/mysqld (5.5.32-MariaDB) + //offsets for: /mariadb/5.5.32/bin/mysqld (5.5.32-MariaDB) {"5.5.32-MariaDB","c67c5c5eaab8467ad1cc170db8e0492d", 12032, 12096, 5816, 6912, 88, 2928, 8, 0, 16, 24}, - //offsets for: /mariadb/5.5.33/bin/mysqld (5.5.33-MariaDB) + //offsets for: /mariadb/5.5.33/bin/mysqld (5.5.33-MariaDB) {"5.5.33-MariaDB","170f56b89ca6a263c625b9f6dd76c6ad", 12032, 12096, 5816, 6912, 88, 2928, 8, 0, 16, 24}, - //offsets for: /mariadb/5.5.33a/bin/mysqld (5.5.33a-MariaDB) + //offsets for: /mariadb/5.5.33a/bin/mysqld (5.5.33a-MariaDB) {"5.5.33a-MariaDB","dc57899efbcc93a0ddf57c1820acf351", 12032, 12096, 5816, 6912, 88, 2928, 8, 0, 16, 24}, - //offsets for: /mariadb/5.5.34/bin/mysqld (5.5.34-MariaDB) + //offsets for: /mariadb/5.5.34/bin/mysqld (5.5.34-MariaDB) {"5.5.34-MariaDB","0c6901e6e213142c3db5176af4329696", 12032, 12096, 5816, 6912, 88, 2928, 8, 0, 16, 24}, - //offsets for: /mariadb/5.5.35/bin/mysqld (5.5.35-MariaDB) - {"5.5.35-MariaDB","18b283a98fa3659cf667446850e338eb", 12040, 12104, 5824, 6920, 88, 2936, 8, 0, 16, 24}, - //offsets for: /mariadb/5.5.36/bin/mysqld (5.5.36-MariaDB) + //offsets for: /mariadb/5.5.35/bin/mysqld (5.5.35-MariaDB) + {"5.5.35-MariaDB","18b283a98fa3659cf667446850e338eb", 12040, 12104, 5824, 6920, 88, 2936, 8, 0, 16, 24}, + //offsets for: /mariadb/5.5.36/bin/mysqld (5.5.36-MariaDB) {"5.5.36-MariaDB","33180ec22cf201f6f769540538318b5b", 12040, 12104, 5824, 6920, 88, 2936, 8, 0, 16, 24}, - //offsets for: /mariadb/5.5.37/bin/mysqld (5.5.37-MariaDB) - {"5.5.37-MariaDB","71b059dd674950c6007fdeb447311707", 12040, 12104, 5824, 6920, 88, 2936, 8, 0, 16, 24} + //offsets for: /mariadb/5.5.37/bin/mysqld (5.5.37-MariaDB) + {"5.5.37-MariaDB","71b059dd674950c6007fdeb447311707", 12040, 12104, 5824, 6920, 88, 2936, 8, 0, 16, 24} }; #else //32 bit offsets const ThdOffsets thd_offsets_arr[] = -{ +{ /* +++ MARIADB 32 OFFSETS GO HERE +++ */ + //offsets for: /mariadb/10.1.13/bin/mysqld (10.1.13-MariaDB) + {"10.1.13-MariaDB","546cb7233e8567aea304fda3d9812a7b", 8472, 8508, 3816, 5276, 44, 1892, 4, 0, 8, 12, 84, 8584}, //offsets for: /mariadb/10.1.12/bin/mysqld (10.1.12-MariaDB) {"10.1.12-MariaDB","590bb2be8fb17c7b3599539d4a69ab44", 8472, 8508, 3816, 5276, 44, 1892, 4, 0, 8, 12, 84, 8584}, - //offsets for: /mariadb/10.0.24/bin/mysqld (10.0.24-MariaDB) - {"10.0.24-MariaDB","2571649d8352ee31a77a2a7a500ed54a", 8344, 8380, 3688, 5148, 44, 1892, 4, 0, 8, 12, 84, 8452}, - //offsets for: /mariadb/5.5.48/bin/mysqld (5.5.48-MariaDB) - {"5.5.48-MariaDB","09caa6790e00e0da77f78159ae5c2558", 7276, 7312, 3460, 4468, 44, 1856, 4, 0, 8, 12, 84, 7372}, - //offsets for: /mariadb/10.1.11/bin/mysqld (10.1.11-MariaDB) - {"10.1.11-MariaDB","bc5982b6028c0ef5d50ff7f8465bc6e5", 8472, 8508, 3816, 5276, 44, 1892, 4, 0, 8, 12, 84, 8584}, - //offsets for: /mariadb/10.1.10/bin/mysqld (10.1.10-MariaDB) - {"10.1.10-MariaDB","102b27c47031aecdf8ffaf881c841e28", 8464, 8500, 3808, 5268, 44, 1884, 4, 0, 8, 12, 84, 8576}, - //offsets for: /mariadb/10.0.23/bin/mysqld (10.0.23-MariaDB) - {"10.0.23-MariaDB","487c1be817fcf314df0edc3f688fdc80", 8336, 8372, 3680, 5140, 44, 1892, 4, 0, 8, 12, 84, 8444}, - //offsets for: /mariadb/10.0.22/bin/mysqld (10.0.22-MariaDB) - {"10.0.22-MariaDB","6fce26b567ab09fc3fe2008a9d8e16b9", 8332, 8368, 3680, 5140, 44, 1892, 4, 0, 8, 12, 84, 8440}, - //offsets for: /mariadb/5.5.47/bin/mysqld (5.5.47-MariaDB) - {"5.5.47-MariaDB","5d7d4f995a41dc09e3a557e0a5529b11", 7276, 7312, 3460, 4468, 44, 1856, 4, 0, 8, 12, 84, 7372}, - //offsets for: /mariadb/10.1.9/bin/mysqld (10.1.9-MariaDB) - {"10.1.9-MariaDB","3f2078219f1098a89a7b12978b33a7e3", 8460, 8496, 3808, 5268, 44, 1884, 4, 0, 8, 12, 84, 8572}, - //offsets for: /mariadb/10.1.8/bin/mysqld (10.1.8-MariaDB) - {"10.1.8-MariaDB","aba39e89c42a58d6ed73f9fd96c75b42", 8460, 8496, 3808, 5268, 44, 1884, 4, 0, 8, 12, 84, 8572}, - //offsets for: /mariadb/5.5.46/bin/mysqld (5.5.46-MariaDB) - {"5.5.46-MariaDB","df034940564625d2ad168799d47190d1", 7276, 7312, 3460, 4468, 44, 1856, 4, 0, 8, 12, 84, 7372}, - //offsets for: /mariadb/10.0.21/bin/mysqld (10.0.21-MariaDB) - {"10.0.21-MariaDB","3b330c8fef5e540fea0060d8778e1e20", 8332, 8368, 3680, 5140, 44, 1892, 4, 0, 8, 12, 84, 8440}, - //offsets for: /mariadb/5.5.45/bin/mysqld (5.5.45-MariaDB) - {"5.5.45-MariaDB","c1b8f68c1012af3fba72fe72066992e0", 7276, 7312, 3460, 4468, 44, 1856, 4, 0, 8, 12, 84, 7372}, - //offsets for: /mariadb/10.0.20/bin/mysqld (10.0.20-MariaDB) - {"10.0.20-MariaDB","707e0ad28b6b6ab79dee1b7e0ce9e7e8", 8328, 8364, 3680, 5136, 44, 1904, 4, 0, 8, 12, 84, 8436}, - //offsets for: /mariadb/5.5.44/bin/mysqld (5.5.44-MariaDB) - {"5.5.44-MariaDB","c1e0214abf6271d97c01c95a905a5527", 7272, 7308, 3460, 4464, 44, 1868, 4, 0, 8, 12, 84, 7368}, - //offsets for: /mariadb/10.0.19/bin/mysqld (10.0.19-MariaDB) - {"10.0.19-MariaDB","c8f349901e9957f505ae00d300f8c9a4", 8328, 8364, 3680, 5136, 44, 1904, 4, 0, 8, 12, 84, 8436}, - //offsets for: /mariadb/10.0.18/bin/mysqld (10.0.18-MariaDB) - {"10.0.18-MariaDB","a1f007a1656689db27b711feb47653a2", 8328, 8364, 3680, 5136, 44, 1904, 4, 0, 8, 12, 84, 8436}, - //offsets for: /mariadb/5.5.43/bin/mysqld (5.5.43-MariaDB) - {"5.5.43-MariaDB","711b99e3b6d5a71934b1eda2c4039d76", 7272, 7308, 3460, 4464, 44, 1868, 4, 0, 8, 12, 84, 7368}, - //offsets for: /mariadb/10.0.17/bin/mysqld (10.0.17-MariaDB) - {"10.0.17-MariaDB","d23ec9269df72a12bbe5b5255f40ed17", 9316, 9352, 3680, 5136, 44, 1904, 4, 0, 8, 12, 84, 9424}, - //offsets for: /mariadb/5.5.42/bin/mysqld (5.5.42-MariaDB) - {"5.5.42-MariaDB","6306b4ed556f3d22517e9a82a7478f7c", 7272, 7308, 3460, 4464, 44, 1868, 4, 0, 8, 12, 84, 7368}, - //offsets for: /mariadb/10.0.16/bin/mysqld (10.0.16-MariaDB) - {"10.0.16-MariaDB","04ad0bec5198a8598e79f2b18492bdcb", 9316, 9352, 3680, 5136, 44, 1904, 4, 0, 8, 12, 84, 9424}, - //offsets for: /mariadb/5.5.41/bin/mysqld (5.5.41-MariaDB) - {"5.5.41-MariaDB","51da3a9aedfde2f4e320c607b1992f74", 7272, 7308, 3460, 4464, 44, 1860, 4, 0, 8, 12}, - //offsets for: /mariadb/10.0.15/bin/mysqld (10.0.15-MariaDB) - {"10.0.15-MariaDB","3b9b7cb72c530207c82929016db7e266", 9316, 9352, 3680, 5136, 44, 1896, 4, 0, 8, 12}, + //offsets for: /mariadb/10.0.24/bin/mysqld (10.0.24-MariaDB) + {"10.0.24-MariaDB","2571649d8352ee31a77a2a7a500ed54a", 8344, 8380, 3688, 5148, 44, 1892, 4, 0, 8, 12, 84, 8452}, + //offsets for: /mariadb/5.5.48/bin/mysqld (5.5.48-MariaDB) + {"5.5.48-MariaDB","09caa6790e00e0da77f78159ae5c2558", 7276, 7312, 3460, 4468, 44, 1856, 4, 0, 8, 12, 84, 7372}, + //offsets for: /mariadb/10.1.11/bin/mysqld (10.1.11-MariaDB) + {"10.1.11-MariaDB","bc5982b6028c0ef5d50ff7f8465bc6e5", 8472, 8508, 3816, 5276, 44, 1892, 4, 0, 8, 12, 84, 8584}, + //offsets for: /mariadb/10.1.10/bin/mysqld (10.1.10-MariaDB) + {"10.1.10-MariaDB","102b27c47031aecdf8ffaf881c841e28", 8464, 8500, 3808, 5268, 44, 1884, 4, 0, 8, 12, 84, 8576}, + //offsets for: /mariadb/10.0.23/bin/mysqld (10.0.23-MariaDB) + {"10.0.23-MariaDB","487c1be817fcf314df0edc3f688fdc80", 8336, 8372, 3680, 5140, 44, 1892, 4, 0, 8, 12, 84, 8444}, + //offsets for: /mariadb/10.0.22/bin/mysqld (10.0.22-MariaDB) + {"10.0.22-MariaDB","6fce26b567ab09fc3fe2008a9d8e16b9", 8332, 8368, 3680, 5140, 44, 1892, 4, 0, 8, 12, 84, 8440}, + //offsets for: /mariadb/5.5.47/bin/mysqld (5.5.47-MariaDB) + {"5.5.47-MariaDB","5d7d4f995a41dc09e3a557e0a5529b11", 7276, 7312, 3460, 4468, 44, 1856, 4, 0, 8, 12, 84, 7372}, + //offsets for: /mariadb/10.1.9/bin/mysqld (10.1.9-MariaDB) + {"10.1.9-MariaDB","3f2078219f1098a89a7b12978b33a7e3", 8460, 8496, 3808, 5268, 44, 1884, 4, 0, 8, 12, 84, 8572}, + //offsets for: /mariadb/10.1.8/bin/mysqld (10.1.8-MariaDB) + {"10.1.8-MariaDB","aba39e89c42a58d6ed73f9fd96c75b42", 8460, 8496, 3808, 5268, 44, 1884, 4, 0, 8, 12, 84, 8572}, + //offsets for: /mariadb/5.5.46/bin/mysqld (5.5.46-MariaDB) + {"5.5.46-MariaDB","df034940564625d2ad168799d47190d1", 7276, 7312, 3460, 4468, 44, 1856, 4, 0, 8, 12, 84, 7372}, + //offsets for: /mariadb/10.0.21/bin/mysqld (10.0.21-MariaDB) + {"10.0.21-MariaDB","3b330c8fef5e540fea0060d8778e1e20", 8332, 8368, 3680, 5140, 44, 1892, 4, 0, 8, 12, 84, 8440}, + //offsets for: /mariadb/5.5.45/bin/mysqld (5.5.45-MariaDB) + {"5.5.45-MariaDB","c1b8f68c1012af3fba72fe72066992e0", 7276, 7312, 3460, 4468, 44, 1856, 4, 0, 8, 12, 84, 7372}, + //offsets for: /mariadb/10.0.20/bin/mysqld (10.0.20-MariaDB) + {"10.0.20-MariaDB","707e0ad28b6b6ab79dee1b7e0ce9e7e8", 8328, 8364, 3680, 5136, 44, 1904, 4, 0, 8, 12, 84, 8436}, + //offsets for: /mariadb/5.5.44/bin/mysqld (5.5.44-MariaDB) + {"5.5.44-MariaDB","c1e0214abf6271d97c01c95a905a5527", 7272, 7308, 3460, 4464, 44, 1868, 4, 0, 8, 12, 84, 7368}, + //offsets for: /mariadb/10.0.19/bin/mysqld (10.0.19-MariaDB) + {"10.0.19-MariaDB","c8f349901e9957f505ae00d300f8c9a4", 8328, 8364, 3680, 5136, 44, 1904, 4, 0, 8, 12, 84, 8436}, + //offsets for: /mariadb/10.0.18/bin/mysqld (10.0.18-MariaDB) + {"10.0.18-MariaDB","a1f007a1656689db27b711feb47653a2", 8328, 8364, 3680, 5136, 44, 1904, 4, 0, 8, 12, 84, 8436}, + //offsets for: /mariadb/5.5.43/bin/mysqld (5.5.43-MariaDB) + {"5.5.43-MariaDB","711b99e3b6d5a71934b1eda2c4039d76", 7272, 7308, 3460, 4464, 44, 1868, 4, 0, 8, 12, 84, 7368}, + //offsets for: /mariadb/10.0.17/bin/mysqld (10.0.17-MariaDB) + {"10.0.17-MariaDB","d23ec9269df72a12bbe5b5255f40ed17", 9316, 9352, 3680, 5136, 44, 1904, 4, 0, 8, 12, 84, 9424}, + //offsets for: /mariadb/5.5.42/bin/mysqld (5.5.42-MariaDB) + {"5.5.42-MariaDB","6306b4ed556f3d22517e9a82a7478f7c", 7272, 7308, 3460, 4464, 44, 1868, 4, 0, 8, 12, 84, 7368}, + //offsets for: /mariadb/10.0.16/bin/mysqld (10.0.16-MariaDB) + {"10.0.16-MariaDB","04ad0bec5198a8598e79f2b18492bdcb", 9316, 9352, 3680, 5136, 44, 1904, 4, 0, 8, 12, 84, 9424}, + //offsets for: /mariadb/5.5.41/bin/mysqld (5.5.41-MariaDB) + {"5.5.41-MariaDB","51da3a9aedfde2f4e320c607b1992f74", 7272, 7308, 3460, 4464, 44, 1860, 4, 0, 8, 12}, + //offsets for: /mariadb/10.0.15/bin/mysqld (10.0.15-MariaDB) + {"10.0.15-MariaDB","3b9b7cb72c530207c82929016db7e266", 9316, 9352, 3680, 5136, 44, 1896, 4, 0, 8, 12}, //offsets for: /mariadb/10.0.14/bin/mysqld (10.0.14-MariaDB) {"10.0.14-MariaDB","311ee785ffab56e289cee28b6ffddcd4", 9316, 9352, 3680, 5136, 44, 1896, 4, 0, 8, 12}, - //offsets for: /mariadb/10.0.10/bin/mysqld (10.0.10-MariaDB) + //offsets for: /mariadb/10.0.10/bin/mysqld (10.0.10-MariaDB) {"10.0.10-MariaDB","80a3f0a2958501ca25c11895efb4e55a", 9312, 9348, 3672, 5128, 44, 1896, 4, 0, 8, 12}, - //offsets for: /mariadb/10.0.11/bin/mysqld (10.0.11-MariaDB) + //offsets for: /mariadb/10.0.11/bin/mysqld (10.0.11-MariaDB) {"10.0.11-MariaDB","07adaf2fffd5a307a10feec5dd2e53d0", 9304, 9340, 3664, 5120, 44, 1896, 4, 0, 8, 12}, - //offsets for: /mariadb/10.0.12/bin/mysqld (10.0.12-MariaDB) + //offsets for: /mariadb/10.0.12/bin/mysqld (10.0.12-MariaDB) {"10.0.12-MariaDB","8cf54bbffb3e26cdfa6826d4f49c02bc", 9304, 9340, 3664, 5120, 44, 1896, 4, 0, 8, 12}, - //offsets for: /mariadb/10.0.13/bin/mysqld (10.0.13-MariaDB) + //offsets for: /mariadb/10.0.13/bin/mysqld (10.0.13-MariaDB) {"10.0.13-MariaDB","c714e7b4e5c789b7b1e0f7043469f241", 9308, 9344, 3672, 5128, 44, 1896, 4, 0, 8, 12}, - //offsets for: /mariadb/10.0.6/bin/mysqld (10.0.6-MariaDB) + //offsets for: /mariadb/10.0.6/bin/mysqld (10.0.6-MariaDB) {"10.0.6-MariaDB","33494970571f6fa8f988c9d1244d13bc", 9284, 9320, 3652, 5100, 44, 1884, 4, 0, 8, 12}, - //offsets for: /mariadb/10.0.7/bin/mysqld (10.0.7-MariaDB) + //offsets for: /mariadb/10.0.7/bin/mysqld (10.0.7-MariaDB) {"10.0.7-MariaDB","dfe202992ca91f1eccf4ddc9311324a5", 9284, 9320, 3652, 5100, 44, 1884, 4, 0, 8, 12}, - //offsets for: /mariadb/10.0.8/bin/mysqld (10.0.8-MariaDB) + //offsets for: /mariadb/10.0.8/bin/mysqld (10.0.8-MariaDB) {"10.0.8-MariaDB","69ce72dc03413f1a6b60e7ec01bf8555", 9292, 9328, 3660, 5108, 44, 1888, 4, 0, 8, 12}, - //offsets for: /mariadb/10.0.9/bin/mysqld (10.0.9-MariaDB) + //offsets for: /mariadb/10.0.9/bin/mysqld (10.0.9-MariaDB) {"10.0.9-MariaDB","e5947442c5b4f14e8ee48accb80a1197", 9312, 9348, 3672, 5128, 44, 1896, 4, 0, 8, 12}, - //offsets for: /mariadb/5.5.40/bin/mysqld (5.5.40-MariaDB) + //offsets for: /mariadb/5.5.40/bin/mysqld (5.5.40-MariaDB) {"5.5.40-MariaDB","0beab0991cb2cf128a4fbd0f3a36ae3b", 7272, 7308, 3460, 4464, 44, 1860, 4, 0, 8, 12}, - //offsets for: /mariadb/5.5.39/bin/mysqld (5.5.39-MariaDB) + //offsets for: /mariadb/5.5.39/bin/mysqld (5.5.39-MariaDB) {"5.5.39-MariaDB","144f0f2a2d98ddbae1e574367e952265", 7272, 7308, 3460, 4464, 44, 1860, 4, 0, 8, 12}, - //offsets for: /mariadb/5.5.38/bin/mysqld (5.5.38-MariaDB) + //offsets for: /mariadb/5.5.38/bin/mysqld (5.5.38-MariaDB) {"5.5.38-MariaDB","39d11f6145bbe9bbf140bb235398969d", 7272, 7308, 3460, 4464, 44, 1860, 4, 0, 8, 12}, - //offsets for: /mariadb/5.5.32/bin/mysqld (5.5.32-MariaDB) + //offsets for: /mariadb/5.5.32/bin/mysqld (5.5.32-MariaDB) {"5.5.32-MariaDB","1c523e9b505795636319e30151eaf022", 7288, 7324, 3476, 4480, 44, 1856, 4, 0, 8, 12}, - //offsets for: /mariadb/5.5.33/bin/mysqld (5.5.33-MariaDB) + //offsets for: /mariadb/5.5.33/bin/mysqld (5.5.33-MariaDB) {"5.5.33-MariaDB","0cdf83696aabc4cba2e9642c3b986f6d", 7288, 7324, 3476, 4480, 44, 1856, 4, 0, 8, 12}, - //offsets for: /mariadb/5.5.33a/bin/mysqld (5.5.33a-MariaDB) + //offsets for: /mariadb/5.5.33a/bin/mysqld (5.5.33a-MariaDB) {"5.5.33a-MariaDB","6b7fa32fe316e16e3adba2fd2940a976", 7288, 7324, 3476, 4480, 44, 1856, 4, 0, 8, 12}, - //offsets for: /mariadb/5.5.34/bin/mysqld (5.5.34-MariaDB) + //offsets for: /mariadb/5.5.34/bin/mysqld (5.5.34-MariaDB) {"5.5.34-MariaDB","13639243e755ca61e45e61cd92c860b2", 7288, 7324, 3476, 4480, 44, 1856, 4, 0, 8, 12}, - //offsets for: /mariadb/5.5.35/bin/mysqld (5.5.35-MariaDB) + //offsets for: /mariadb/5.5.35/bin/mysqld (5.5.35-MariaDB) {"5.5.35-MariaDB","1dc4e9caca4b9aa2440943ba3355a572", 7296, 7332, 3484, 4488, 44, 1860, 4, 0, 8, 12}, - //offsets for: /mariadb/5.5.36/bin/mysqld (5.5.36-MariaDB) + //offsets for: /mariadb/5.5.36/bin/mysqld (5.5.36-MariaDB) {"5.5.36-MariaDB","5cf95a64e10e2b53b8c85554874d034b", 7296, 7332, 3484, 4488, 44, 1860, 4, 0, 8, 12}, - //offsets for: /mariadb/5.5.37/bin/mysqld (5.5.37-MariaDB) + //offsets for: /mariadb/5.5.37/bin/mysqld (5.5.37-MariaDB) {"5.5.37-MariaDB","f4434929944d7e9c4351b51e30c0d4d6", 7296, 7332, 3484, 4488, 44, 1860, 4, 0, 8, 12} }; #endif @@ -1003,4 +994,3 @@ const ThdOffsets thd_offsets_arr[] = //the size of the offsets arr const size_t thd_offsets_arr_size = array_elements(thd_offsets_arr); - diff --git a/src/audit_plugin.cc b/src/audit_plugin.cc index 224117b..8d43afb 100644 --- a/src/audit_plugin.cc +++ b/src/audit_plugin.cc @@ -21,7 +21,7 @@ #include #include #if MYSQL_VERSION_ID >= 50600 -//in 5.6 md5 implementation changed and we include our own +// in 5.6 md5 implementation changed and we include our own #include "md5.h" #endif @@ -31,18 +31,18 @@ #if !defined(__attribute__) && !defined(__GNUC__) #define __attribute__(A) #endif - */ +*/ -static const char * log_prefix = AUDIT_LOG_PREFIX; +static const char *log_prefix = AUDIT_LOG_PREFIX; -//possible audit handlers +// possible audit handlers static Audit_file_handler json_file_handler; static Audit_socket_handler json_socket_handler; -//formatters +// formatters static Audit_json_formatter json_formatter; -//flags to hold if audit handlers are enabled +// flags to hold if audit handlers are enabled static my_bool json_file_handler_enable = FALSE; static my_bool force_record_logins_enable = FALSE; static my_bool json_file_handler_flush = FALSE; @@ -51,8 +51,8 @@ static my_bool uninstall_plugin_enable = FALSE; static my_bool validate_checksum_enable = FALSE; static my_bool offsets_by_version_enable = FALSE; static my_bool validate_offsets_extended_enable = FALSE; -static char * offsets_string = NULL; -static char * checksum_string = NULL; +static char *offsets_string = NULL; +static char *checksum_string = NULL; static int delay_ms_val =0; static char *delay_cmds_string = NULL; static char delay_cmds_buff[4096] = {0}; @@ -82,7 +82,7 @@ static int num_record_objs = 0; static int num_whitelist_users = 0; static SHOW_VAR com_status_vars_array [MAX_COM_STATUS_VARS_RECORDS] = {{0}}; -//regex stuff +// regex stuff static char password_masking_regex_check_buff[4096] = {0}; static char * password_masking_regex_string = NULL; static char password_masking_regex_buff[4096] = {0}; @@ -91,120 +91,125 @@ static char password_masking_regex_buff[4096] = {0}; #define _QUOTED_PSW_ "[\'|\"](?.*?)(?.*)@\\S+[\'|\"]" - ; - + // identified by [password] '***' + "identified"_COMMENT_SPACE_"by"_COMMENT_SPACE_"(?:password)?"_COMMENT_SPACE_ _QUOTED_PSW_ + // password function + "|password"_COMMENT_SPACE_"\\("_COMMENT_SPACE_ _QUOTED_PSW_ _COMMENT_SPACE_"\\)" + // Used at: CHANGE MASTER TO MASTER_PASSWORD='new3cret', SET PASSWORD [FOR user] = 'hash', password 'user_pass'; + "|password"_COMMENT_SPACE_"(?:for"_COMMENT_SPACE_"\\S+?)?"_COMMENT_SPACE_"="_COMMENT_SPACE_ _QUOTED_PSW_ + "|password"_COMMENT_SPACE_ _QUOTED_PSW_ + // federated engine create table with connection. See: http://dev.mysql.com/doc/refman/5.5/en/federated-create-connection.html + // commented out as federated engine is disabled by default + // "|ENGINE"_COMMENT_SPACE_"="_COMMENT_SPACE_"FEDERATED"_COMMENT_SPACE_".*CONNECTION"_COMMENT_SPACE_"="_COMMENT_SPACE_"[\'|\"]\\S+?://\\S+?:(?.*)@\\S+[\'|\"]" + ; -//socket name +// socket name static char json_socket_name_buff[1024] = {0}; - /** * The trampoline functions we use. Will be set to point to allocated mem. */ static int (*trampoline_mysql_execute_command)(THD *thd) = NULL; -static unsigned int trampoline_mysql_execute_size =0; +static unsigned int trampoline_mysql_execute_size = 0; #if MYSQL_VERSION_ID < 50600 static void (*trampoline_log_slow_statement)(THD *thd) = NULL; -static unsigned int trampoline_log_slow_statement_size =0; +static unsigned int trampoline_log_slow_statement_size = 0; #endif #if MYSQL_VERSION_ID < 50505 static int (*trampoline_check_user)(THD *thd, enum enum_server_command command, const char *passwd, uint passwd_len, const char *db, bool check_count) = NULL; -static unsigned int trampoline_check_user_size =0; +static unsigned int trampoline_check_user_size = 0; #elif MYSQL_VERSION_ID < 50600 static bool (*trampoline_acl_authenticate)(THD *thd, uint connect_errors, uint com_change_user_pkt_len) = NULL; -static unsigned int trampoline_acl_authenticate_size =0; +static unsigned int trampoline_acl_authenticate_size = 0; #endif static MYSQL_THDVAR_ULONG(is_thd_printed_list, - PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_NOCMDOPT, "avoid duplicate printing", -NULL, NULL,0,0, + PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_NOCMDOPT, + "avoid duplicate printing", + NULL, NULL,0,0, #ifdef __x86_64__ -0xffffffffffffff, + 0xffffffffffffff, #else -0xffffffff, -#endif -1); + 0xffffffff, +#endif + 1); static MYSQL_THDVAR_ULONG(query_cache_table_list, - PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_NOCMDOPT, "Pointer to query cache table list.", -NULL, NULL,0,0, + PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_NOCMDOPT, + "Pointer to query cache table list.", + NULL, NULL,0,0, #ifdef __x86_64__ -0xffffffffffffff, + 0xffffffffffffff, #else -0xffffffff, + 0xffffffff, #endif -1); + 1); -THDPRINTED * GetThdPrintedList (THD *thd) +THDPRINTED *GetThdPrintedList(THD *thd) { - THDPRINTED * pThdPrintedList= (THDPRINTED*)THDVAR(thd,is_thd_printed_list); - if (pThdPrintedList) - { - return pThdPrintedList; - } - THDVAR(thd,is_thd_printed_list) =0; - return NULL; - } - -static int check_array(const char *cmds[],const char *array, int length) { - for (int k=0; array[k * length] !='\0';k++) { - for (int q = 0; cmds[q] != NULL; q++) { - const char *cmd = cmds[q]; - int j = 0; - while (array[k * length + j] != '\0' && cmd[j] != '\0' - && array[k * length + j] == tolower(cmd[j])) { - j++; - } - if (array[k * length + j] == '\0' && j != 0) { - return 1; - } - } - } - return 0; + THDPRINTED *pThdPrintedList= (THDPRINTED*) THDVAR(thd, is_thd_printed_list); + if (pThdPrintedList) + { + return pThdPrintedList; + } + THDVAR(thd,is_thd_printed_list) =0; + return NULL; } -//utility method checks if the passed db object is part of record_objs_array -static bool check_db_obj(const char * db, const char * name) +static int check_array(const char *cmds[],const char *array, int length) { - char db_obj[MAX_OBJECT_CHAR_NUMBERS] = {0}; - char wildcard_obj[MAX_OBJECT_CHAR_NUMBERS] = {0}; - char db_wildcard[MAX_OBJECT_CHAR_NUMBERS] = {0}; - if(db && name && - ((strlen(db) + strlen(name)) < MAX_OBJECT_CHAR_NUMBERS - 2)) - { - strcpy(db_obj, db); - strcat(db_obj, "."); - strcat(db_obj, name); - strcpy(wildcard_obj, "*."); - strcat(wildcard_obj, name); - strcpy(db_wildcard, db); - strcat(db_wildcard, ".*"); - const char *objects[4]; - objects[0] = db_obj; - objects[1] = wildcard_obj; - objects[2] = db_wildcard; - objects[3] = NULL; - return check_array(objects, (char *) record_objs_array, MAX_OBJECT_CHAR_NUMBERS); - } - return false; + for (int k = 0; array[k * length] !='\0';k++) + { + for (int q = 0; cmds[q] != NULL; q++) + { + const char *cmd = cmds[q]; + int j = 0; + while (array[k * length + j] != '\0' && cmd[j] != '\0' + && array[k * length + j] == tolower(cmd[j])) + { + j++; + } + if (array[k * length + j] == '\0' && j != 0) + { + return 1; + } + } + } + return 0; } -//callback function returns if password masking is required according to cmd type +// utility method checks if the passed db object is part of record_objs_array +static bool check_db_obj(const char *db, const char *name) +{ + char db_obj[MAX_OBJECT_CHAR_NUMBERS] = {0}; + char wildcard_obj[MAX_OBJECT_CHAR_NUMBERS] = {0}; + char db_wildcard[MAX_OBJECT_CHAR_NUMBERS] = {0}; + if (db && name && + ((strlen(db) + strlen(name)) < MAX_OBJECT_CHAR_NUMBERS - 2)) + { + strcpy(db_obj, db); + strcat(db_obj, "."); + strcat(db_obj, name); + strcpy(wildcard_obj, "*."); + strcat(wildcard_obj, name); + strcpy(db_wildcard, db); + strcat(db_wildcard, ".*"); + const char *objects[4]; + objects[0] = db_obj; + objects[1] = wildcard_obj; + objects[2] = db_wildcard; + objects[3] = NULL; + return check_array(objects, (char *) record_objs_array, MAX_OBJECT_CHAR_NUMBERS); + } + return false; +} + +// callback function returns if password masking is required according to cmd type static my_bool check_do_password_masking(const char * cmd) { - if(num_password_masking_cmds > 0) + if (num_password_masking_cmds > 0) { const char *cmds[2]; cmds[0] = cmd; @@ -216,94 +221,114 @@ static my_bool check_do_password_masking(const char * cmd) static void audit(ThdSesData *pThdData) { - THDPRINTED *pThdPrintedList = GetThdPrintedList (pThdData->getTHD()); - if (num_whitelist_cmds > 0) { - const char * cmd = pThdData->getCmdName(); - const char *cmds[2]; - cmds[0] = cmd; - cmds[1] = NULL; - if (check_array(cmds, (char *) whitelist_cmds_array, MAX_COMMAND_CHAR_NUMBERS)) { - return; - } - } - if (num_whitelist_users > 0) { - const char * user = pThdData->getUserName(); //If name is present, then no need to log the query - const char *users[2]; - if(NULL == user || '\0' == user[0]) //empty user use special symbol: "{}" - { - user = "{}"; - } - users[0] = user; - users[1] = NULL; - if (check_array(users, (char *) whitelist_users_array, MAX_USER_CHAR_NUMBERS)) { - return; - } - } - bool do_objs_cmds_check = true; - if (force_record_logins_enable) { - const char * cmd = pThdData->getCmdName(); - if (!strcasecmp(cmd, "Connect") || !strcasecmp(cmd, "Quit") || !strcasecmp(cmd, "Failed Login")) { - do_objs_cmds_check = false; - } - } - if (num_record_cmds > 0 && do_objs_cmds_check) { - const char * cmd = pThdData->getCmdName(); - const char *cmds[2]; - cmds[0] = cmd; - cmds[1] = NULL; - if (!check_array(cmds, (char *) record_cmds_array, MAX_COMMAND_CHAR_NUMBERS)) { - return; - } - } - if (num_record_objs > 0 && do_objs_cmds_check) { - bool matched = false; - if(pThdData->startGetObjects()) - { - const char * db_name = NULL; - const char * obj_name = NULL; - while(!matched && pThdData->getNextObject(&db_name, &obj_name, NULL)) - { - matched = check_db_obj(db_name, obj_name); - } - } - else //no objects + THDPRINTED *pThdPrintedList = GetThdPrintedList(pThdData->getTHD()); + + if (num_whitelist_cmds > 0) { - matched = record_empty_objs_set; - } - if (!matched) { - return; - } - } - if (pThdPrintedList && pThdPrintedList->cur_index < MAX_NUM_QUEUE_ELEM) - { - //audit the event if we haven't done so yet or in the case of prepare_sql we audit as the test "test select" doesn't go through mysql_execute_command - if (pThdPrintedList->is_thd_printed_queue[pThdPrintedList->cur_index] == 0 || strcmp(pThdData->getCmdName(), "prepare_sql") == 0) - { - Audit_handler::log_audit_all(pThdData); - pThdPrintedList->is_thd_printed_queue[pThdPrintedList->cur_index] = 1; - } - else //duplicate no need to audit then simply return + const char * cmd = pThdData->getCmdName(); + const char *cmds[2]; + cmds[0] = cmd; + cmds[1] = NULL; + if (check_array(cmds, (char *) whitelist_cmds_array, MAX_COMMAND_CHAR_NUMBERS)) { return; } - } - else - { - Audit_handler::log_audit_all(pThdData); } - if (delay_ms_val > 0) + + if (num_whitelist_users > 0) { - const char * cmd = pThdData->getCmdName(); - const char *cmds[2]; - cmds[0] = cmd; - cmds[1] = NULL; - int delay = check_array(cmds, (char *) delay_cmds_array, MAX_COMMAND_CHAR_NUMBERS); - if (delay) + const char *user = pThdData->getUserName(); // If name is present, then no need to log the query + const char *users[2]; + if (NULL == user || '\0' == user[0]) // empty user use special symbol: "{}" + { + user = "{}"; + } + users[0] = user; + users[1] = NULL; + if (check_array(users, (char *) whitelist_users_array, MAX_USER_CHAR_NUMBERS)) + { + return; + } + } + + bool do_objs_cmds_check = true; + if (force_record_logins_enable) + { + const char *cmd = pThdData->getCmdName(); + if (strcasecmp(cmd, "Connect") == 0 + || strcasecmp(cmd, "Quit") == 0 + || strcasecmp(cmd, "Failed Login") == 0) + { + do_objs_cmds_check = false; + } + } + + if (num_record_cmds > 0 && do_objs_cmds_check) + { + const char *cmd = pThdData->getCmdName(); + const char *cmds[2]; + cmds[0] = cmd; + cmds[1] = NULL; + if (! check_array(cmds, (char *) record_cmds_array, MAX_COMMAND_CHAR_NUMBERS)) + { + return; + } + } + + if (num_record_objs > 0 && do_objs_cmds_check) + { + bool matched = false; + if (pThdData->startGetObjects()) + { + const char *db_name = NULL; + const char *obj_name = NULL; + while(!matched && pThdData->getNextObject(&db_name, &obj_name, NULL)) { - //Audit_file_handler::print_sleep(thd,delay_ms_val); - my_sleep (delay_ms_val *1000); + matched = check_db_obj(db_name, obj_name); } } + else // no objects + { + matched = record_empty_objs_set; + } + if (! matched) + { + return; + } + } + + if (pThdPrintedList && pThdPrintedList->cur_index < MAX_NUM_QUEUE_ELEM) + { + // audit the event if we haven't done so yet or in the case of prepare_sql + // we audit as the test "test select" doesn't go through mysql_execute_command + if (pThdPrintedList->is_thd_printed_queue[pThdPrintedList->cur_index] == 0 || strcmp(pThdData->getCmdName(), "prepare_sql") == 0) + { + Audit_handler::log_audit_all(pThdData); + pThdPrintedList->is_thd_printed_queue[pThdPrintedList->cur_index] = 1; + } + else // duplicate no need to audit then simply return + { + return; + } + } + else + { + Audit_handler::log_audit_all(pThdData); + } + + if (delay_ms_val > 0) + { + const char * cmd = pThdData->getCmdName(); + const char *cmds[2]; + cmds[0] = cmd; + cmds[1] = NULL; + int delay = check_array(cmds, (char *) delay_cmds_array, MAX_COMMAND_CHAR_NUMBERS); + if (delay) + { + // Audit_file_handler::print_sleep(thd,delay_ms_val); + my_sleep (delay_ms_val *1000); + } + } } @@ -315,7 +340,7 @@ static int (*trampoline_send_result_to_client)(Query_cache *pthis, THD *thd, co #if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100108 static bool (*trampoline_open_tables)(THD *thd, const DDL_options_st &options, TABLE_LIST **start, uint *counter, uint flags, - Prelocking_strategy *prelocking_strategy) = NULL; + Prelocking_strategy *prelocking_strategy) = NULL; #elif MYSQL_VERSION_ID > 50505 static bool (*trampoline_open_tables)(THD *thd, TABLE_LIST **start, uint *counter, uint flags, Prelocking_strategy *prelocking_strategy) = NULL; @@ -324,16 +349,15 @@ static int (*trampoline_open_tables)(THD *thd, TABLE_LIST **start, uint *counter #endif -QueryTableInf * Audit_formatter::getQueryCacheTableList1 (THD *thd) +QueryTableInf *Audit_formatter::getQueryCacheTableList1(THD *thd) { - return (QueryTableInf*) THDVAR(thd, query_cache_table_list); } static bool (*trampoline_check_table_access)(THD *thd, ulong want_access,TABLE_LIST *tables, uint number, bool no_errors) = NULL; static bool audit_check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables, - uint number, bool no_errors) + uint number, bool no_errors) { TABLE_LIST *pTables; bool res = trampoline_check_table_access (thd, want_access, tables, number, no_errors); @@ -351,13 +375,12 @@ static bool audit_check_table_access(THD *thd, ulong want_access,TABLE_LIST *tab strcpy (pQueryTableInf->db[pQueryTableInf->num_of_elem],Audit_formatter::table_get_db_name(pTables)); pQueryTableInf->table_name[pQueryTableInf->num_of_elem] = (char*) thd_alloc (thd, strlen(Audit_formatter::table_get_name(pTables)) +1); strcpy (pQueryTableInf->table_name[pQueryTableInf->num_of_elem],Audit_formatter::table_get_name(pTables)); - pQueryTableInf->object_type[pQueryTableInf->num_of_elem] = Audit_formatter::retrieve_object_type ( pTables); + pQueryTableInf->object_type[pQueryTableInf->num_of_elem] = Audit_formatter::retrieve_object_type ( pTables); pQueryTableInf->num_of_elem ++; } pTables = pTables->next_global; } - - } + } } return res; } @@ -370,29 +393,30 @@ static int audit_send_result_to_client(Query_cache *pthis, THD *thd, char *sql, static int audit_send_result_to_client(Query_cache *pthis, THD *thd, const LEX_CSTRING& sql_query) #endif { - int res; - void *pList = thd_alloc (thd, sizeof (QueryTableInf)); - + int res; + void *pList = thd_alloc (thd, sizeof (QueryTableInf)); if (pList) - { - memset (pList,0,sizeof (QueryTableInf)); - THDVAR(thd, query_cache_table_list) =(ulong)pList; - } + { + memset (pList,0,sizeof (QueryTableInf)); + THDVAR(thd, query_cache_table_list) =(ulong)pList; + } + #if defined(MARIADB_BASE_VERSION) || MYSQL_VERSION_ID < 50709 - res = trampoline_send_result_to_client (pthis,thd, sql, query_length); + res = trampoline_send_result_to_client (pthis,thd, sql, query_length); #else - res = trampoline_send_result_to_client (pthis, thd, sql_query); + res = trampoline_send_result_to_client (pthis, thd, sql_query); #endif - if (res) - { - ThdSesData thd_data (thd); - audit (&thd_data); - } - THDVAR(thd, query_cache_table_list) = 0; - return res; + if (res) + { + ThdSesData thd_data (thd); + audit (&thd_data); + } + THDVAR(thd, query_cache_table_list) = 0; + return res; } -static unsigned int trampoline_send_result_to_client_size =0; + +static unsigned int trampoline_send_result_to_client_size = 0; #if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100108 static bool audit_open_tables(THD *thd, const DDL_options_st &options, TABLE_LIST **start, uint *counter, uint flags, @@ -404,42 +428,38 @@ static bool audit_open_tables(THD *thd, const DDL_options_st &options, TABLE_LIS static bool audit_open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags, Prelocking_strategy *prelocking_strategy) { - - bool res; - res = trampoline_open_tables (thd, start, counter, flags, prelocking_strategy); + bool res; + res = trampoline_open_tables (thd, start, counter, flags, prelocking_strategy); #else static int audit_open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags) { - int res; - res = trampoline_open_tables (thd, start, counter, flags); -#endif - //only log if thread id or query id is non 0 (otherwise this is comming from startup activity) - if(Audit_formatter::thd_inst_thread_id(thd) || Audit_formatter::thd_inst_query_id(thd)) - { - ThdSesData thd_data (thd); - audit(&thd_data); - } - return res; + int res; + res = trampoline_open_tables (thd, start, counter, flags); +#endif + // only log if thread id or query id is non 0 (otherwise this is comming from startup activity) + if (Audit_formatter::thd_inst_thread_id(thd) || Audit_formatter::thd_inst_query_id(thd)) + { + ThdSesData thd_data (thd); + audit(&thd_data); + } + return res; } - -static unsigned int trampoline_open_tables_size =0; +static unsigned int trampoline_open_tables_size = 0; - - -//called by log_slow_statement and general audit event caught by audit interface +// called by log_slow_statement and general audit event caught by audit interface static void audit_post_execute(THD * thd) { - //only audit non query events - //query events are audited by mysql execute command - if (Audit_formatter::thd_inst_command(thd) != COM_QUERY) - { - ThdSesData ThdData (thd); - if (strcasestr (ThdData.getCmdName(), "show_fields")==NULL) - { - audit(&ThdData); - } - } + // only audit non query events + // query events are audited by mysql execute command + if (Audit_formatter::thd_inst_command(thd) != COM_QUERY) + { + ThdSesData ThdData (thd); + if (strcasestr(ThdData.getCmdName(), "show_fields") == NULL) + { + audit(&ThdData); + } + } } @@ -447,13 +467,12 @@ static void audit_post_execute(THD * thd) /* Plugin descriptor */ -//in 5.6 we use the AUDIT plugin interface. In 5.1/5.5 we just use the general DAEMON plugin +// in 5.6 we use the AUDIT plugin interface. In 5.1/5.5 we just use the general DAEMON plugin #if MYSQL_VERSION_ID < 50600 static int plugin_type = MYSQL_DAEMON_PLUGIN; -static struct st_mysql_daemon audit_plugin = -{ MYSQL_DAEMON_INTERFACE_VERSION }; +static struct st_mysql_daemon audit_plugin = { MYSQL_DAEMON_INTERFACE_VERSION }; #else @@ -465,104 +484,103 @@ static int audit_notify(THD *thd, mysql_event_class_t event_class, const void * event) #endif { - if (MYSQL_AUDIT_GENERAL_CLASS == event_class) - { - const struct mysql_event_general *event_general = - (const struct mysql_event_general *) event; - if(MYSQL_AUDIT_GENERAL_STATUS == event_general->event_subclass) - { - audit_post_execute(thd); - } - } - else if (MYSQL_AUDIT_CONNECTION_CLASS == event_class) - { - const struct mysql_event_connection *event_connection = - (const struct mysql_event_connection *) event; - //only audit for connect and change_user. disconnect is caught by general event - if(event_connection->event_subclass != MYSQL_AUDIT_CONNECTION_DISCONNECT) - { - ThdSesData ThdData (thd); - audit (&ThdData); - } - } + if (MYSQL_AUDIT_GENERAL_CLASS == event_class) + { + const struct mysql_event_general *event_general = + (const struct mysql_event_general *) event; + if (MYSQL_AUDIT_GENERAL_STATUS == event_general->event_subclass) + { + audit_post_execute(thd); + } + } + else if (MYSQL_AUDIT_CONNECTION_CLASS == event_class) + { + const struct mysql_event_connection *event_connection = + (const struct mysql_event_connection *) event; + // only audit for connect and change_user. disconnect is caught by general event + if (event_connection->event_subclass != MYSQL_AUDIT_CONNECTION_DISCONNECT) + { + ThdSesData ThdData (thd); + audit (&ThdData); + } + } #if ! defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50709 - return 0; // Zero means success, MySQL continues processing the event. + return 0; // Zero means success, MySQL continues processing the event. #endif } static int plugin_type = MYSQL_AUDIT_PLUGIN; -static struct st_mysql_audit audit_plugin= +static struct st_mysql_audit audit_plugin = { - MYSQL_AUDIT_INTERFACE_VERSION, /* interface version */ - NULL, /* release_thd function */ - audit_notify, /* notify function */ + MYSQL_AUDIT_INTERFACE_VERSION, /* interface version */ + NULL, /* release_thd function */ + audit_notify, /* notify function */ #if ! defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50709 - // As of 5.7.9, this is an array of bitmaps of events that we're interested in. - { (unsigned long) MYSQL_AUDIT_GENERAL_ALL, - (unsigned long) MYSQL_AUDIT_CONNECTION_ALL, - 0, - 0, - 0, - 0, - 0, - 0, - (unsigned long) MYSQL_AUDIT_COMMAND_ALL, - 0, - 0 - } + // As of 5.7.9, this is an array of bitmaps of events that we're interested in. + { (unsigned long) MYSQL_AUDIT_GENERAL_ALL, + (unsigned long) MYSQL_AUDIT_CONNECTION_ALL, + 0, + 0, + 0, + 0, + 0, + 0, + (unsigned long) MYSQL_AUDIT_COMMAND_ALL, + 0, + 0 + } #else - { (unsigned long) MYSQL_AUDIT_GENERAL_CLASSMASK | - MYSQL_AUDIT_CONNECTION_CLASSMASK } /* class mask */ - + { (unsigned long) MYSQL_AUDIT_GENERAL_CLASSMASK | + MYSQL_AUDIT_CONNECTION_CLASSMASK } /* class mask */ #endif }; #endif - -//some extern definitions which are not in include files +// some extern definitions which are not in include files extern void log_slow_statement(THD *thd); extern int mysql_execute_command(THD *thd); #if MYSQL_VERSION_ID >= 50505 -//in 5.5 builtins is named differently +// in 5.5 builtins is named differently #define mysqld_builtins mysql_mandatory_plugins #endif extern struct st_mysql_plugin *mysqld_builtins[]; - -void remove_hot_functions () +void remove_hot_functions() { - void * target_function = NULL; + void * target_function = NULL; + #if MYSQL_VERSION_ID < 50600 target_function = (void *) log_slow_statement; remove_hot_patch_function(target_function, - (void*) trampoline_log_slow_statement, trampoline_log_slow_statement_size, true); - trampoline_log_slow_statement_size=0; + (void*) trampoline_log_slow_statement, trampoline_log_slow_statement_size, true); + trampoline_log_slow_statement_size = 0; #endif + #if MYSQL_VERSION_ID < 50505 target_function = (void *) check_user; remove_hot_patch_function(target_function, - (void*) trampoline_check_user, trampoline_check_user_size, true); - trampoline_check_user_size=0; + (void*) trampoline_check_user, trampoline_check_user_size, true); + trampoline_check_user_size = 0; #elif MYSQL_VERSION_ID < 50600 - target_function = (void *) acl_authenticate; + target_function = (void *) acl_authenticate; remove_hot_patch_function(target_function, - (void*) trampoline_acl_authenticate, trampoline_acl_authenticate_size, true); - trampoline_acl_authenticate_size=0; -#endif + (void*) trampoline_acl_authenticate, trampoline_acl_authenticate_size, true); + trampoline_acl_authenticate_size = 0; +#endif #if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100108 - target_function = (void *)*(bool (*)(THD *thd, const DDL_options_st &options, TABLE_LIST **start, uint *counter, uint flags, - Prelocking_strategy *prelocking_strategy)) &open_tables; + target_function = (void *)*(bool (*)(THD *thd, const DDL_options_st &options, TABLE_LIST **start, uint *counter, uint flags, + Prelocking_strategy *prelocking_strategy)) &open_tables; #elif MYSQL_VERSION_ID > 50505 target_function = (void *)*(bool (*)(THD *thd, TABLE_LIST **start, uint *counter, uint flags, - Prelocking_strategy *prelocking_strategy)) &open_tables; + Prelocking_strategy *prelocking_strategy)) &open_tables; #else target_function = (void *)*(int (*)(THD *thd, TABLE_LIST **start, uint *counter, uint flags)) &open_tables; #endif remove_hot_patch_function(target_function, - (void*) trampoline_open_tables, trampoline_open_tables_size, true); - trampoline_open_tables_size=0; + (void*) trampoline_open_tables, trampoline_open_tables_size, true); + trampoline_open_tables_size = 0; #if defined(MARIADB_BASE_VERSION) || MYSQL_VERSION_ID < 50709 int (Query_cache::*pf_send_result_to_client)(THD *,char *, uint) = &Query_cache::send_result_to_client; @@ -571,12 +589,12 @@ void remove_hot_functions () #endif target_function = *(void **) &pf_send_result_to_client; remove_hot_patch_function(target_function, - (void*) trampoline_send_result_to_client, trampoline_send_result_to_client_size, true); - trampoline_send_result_to_client_size=0; + (void*) trampoline_send_result_to_client, trampoline_send_result_to_client_size, true); + trampoline_send_result_to_client_size = 0; remove_hot_patch_function((void*) check_table_access, - (void*) trampoline_check_table_access, - trampoline_check_table_access_size, true); + (void*) trampoline_check_table_access, + trampoline_check_table_access_size, true); trampoline_check_table_access_size=0; #if defined(MARIADB_BASE_VERSION) || MYSQL_VERSION_ID < 50709 @@ -586,125 +604,135 @@ void remove_hot_functions () (int (*)(THD *thd, bool first_level)) &mysql_execute_command; #endif remove_hot_patch_function(target_function, - (void*) trampoline_mysql_execute_command, - trampoline_mysql_execute_size, true); - trampoline_mysql_execute_size=0; + (void*) trampoline_mysql_execute_command, + trampoline_mysql_execute_size, true); + trampoline_mysql_execute_size = 0; } -int is_remove_patches (ThdSesData *pThdData) - { - - static bool called_once = false; - const char *cmd = pThdData->getCmdName(); - const char *sUninstallPlugin = "uninstall_plugin"; - LEX *pLex = Audit_formatter::thd_lex(pThdData->getTHD()); - if (pThdData->getTHD() && pLex!=NULL && strncasecmp (cmd,sUninstallPlugin ,strlen (sUninstallPlugin))==0 ) +int is_remove_patches(ThdSesData *pThdData) +{ + static bool called_once = false; + const char *cmd = pThdData->getCmdName(); + const char *sUninstallPlugin = "uninstall_plugin"; + LEX *pLex = Audit_formatter::thd_lex(pThdData->getTHD()); + if (pThdData->getTHD() && pLex!=NULL && strncasecmp(cmd, sUninstallPlugin, strlen(sUninstallPlugin)) == 0) + { + LEX_STRING Lex_comment = *(LEX_STRING*)(((unsigned char *) pLex) + Audit_formatter::thd_offsets.lex_comment); + if (strncasecmp(Lex_comment.str, "AUDIT", 5) == 0) { - LEX_STRING Lex_comment = *(LEX_STRING*)(((unsigned char *) pLex) + Audit_formatter::thd_offsets.lex_comment); - if (strncasecmp(Lex_comment.str, "AUDIT", 5) == 0) + if (! uninstall_plugin_enable) { - if (!uninstall_plugin_enable) - { - - my_message (ER_NOT_ALLOWED_COMMAND,"Uninstall AUDIT plugin disabled",MYF(0)); - return 2; - } - Audit_handler::stop_all(); - remove_hot_functions (); - if(!called_once) - { - called_once = true; - my_message (WARN_PLUGIN_BUSY,"Uninstall AUDIT plugin must be called again to complete",MYF(0)); - return 2; - } - return 1; + my_message(ER_NOT_ALLOWED_COMMAND, "Uninstall AUDIT plugin disabled", MYF(0)); + return 2; } + + Audit_handler::stop_all(); + remove_hot_functions(); + + if (! called_once) + { + called_once = true; + my_message(WARN_PLUGIN_BUSY, "Uninstall AUDIT plugin must be called again to complete", MYF(0)); + return 2; + } + return 1; } + } return 0; } /* - * Over ride functions for hot patch + audit. We call our audit function + * Override functions for hot patch + audit. We call our audit function * after the execute command so all tables are resolved. */ -static int audit_mysql_execute_command(THD *thd) +static int audit_mysql_execute_command(THD *thd) { - bool firstTime = false; - THDPRINTED *pThdPrintedList = GetThdPrintedList (thd); - if (pThdPrintedList) - { - if (pThdPrintedList->cur_index < (MAX_NUM_QUEUE_ELEM -1) ) - { - pThdPrintedList->cur_index ++; - pThdPrintedList->is_thd_printed_queue[pThdPrintedList->cur_index] =0; - } - } - else - { - firstTime = true; - pThdPrintedList = (THDPRINTED *) thd_alloc (thd, sizeof (THDPRINTED)); - if (pThdPrintedList) - { - memset (pThdPrintedList, 0, sizeof (THDPRINTED)); - //pThdPrintedList->cur_index = 0; - THDVAR(thd,is_thd_printed_list) = (ulong) pThdPrintedList; - } - } - ThdSesData thd_data (thd); - const char *cmd = thd_data.getCmdName(); - if (strcasestr (cmd,"alter") !=NULL || strcasestr (cmd,"drop") !=NULL || strcasestr (cmd, "create") !=NULL || strcasestr (cmd, "truncate") !=NULL || strcasestr (cmd, "rename") !=NULL) - { - audit(&thd_data); - } - int res; -#if defined(MARIADB_BASE_VERSION) - if(Audit_formatter::thd_killed(thd) >= KILL_CONNECTION) -#else - if(Audit_formatter::thd_killed(thd) == THD::KILL_CONNECTION) -#endif + bool firstTime = false; + THDPRINTED *pThdPrintedList = GetThdPrintedList(thd); + + if (pThdPrintedList) { - res = 1; + if (pThdPrintedList->cur_index < (MAX_NUM_QUEUE_ELEM - 1)) + { + pThdPrintedList->cur_index++; + pThdPrintedList->is_thd_printed_queue[pThdPrintedList->cur_index] = 0; + } } else { - switch (is_remove_patches(&thd_data)) - { - case 1: - //hot patch function were removed and we call the real execute (restored) + firstTime = true; + pThdPrintedList = (THDPRINTED *) thd_alloc (thd, sizeof(THDPRINTED)); + if (pThdPrintedList) + { + memset(pThdPrintedList, 0, sizeof(THDPRINTED)); + // pThdPrintedList->cur_index = 0; + THDVAR(thd,is_thd_printed_list) = (ulong) pThdPrintedList; + } + } + + ThdSesData thd_data(thd); + const char *cmd = thd_data.getCmdName(); + + if (strcasestr(cmd, "alter") != NULL || + strcasestr(cmd, "drop") != NULL || + strcasestr(cmd, "create") != NULL || + strcasestr(cmd, "truncate") != NULL || + strcasestr(cmd, "rename") != NULL) + { + audit(&thd_data); + } + + int res; +#if defined(MARIADB_BASE_VERSION) + if (Audit_formatter::thd_killed(thd) >= KILL_CONNECTION) +#else + if (Audit_formatter::thd_killed(thd) == THD::KILL_CONNECTION) +#endif + { + res = 1; + } + else + { + switch (is_remove_patches(&thd_data)) + { + case 1: + // hot patch function were removed and we call the real execute (restored) #if defined(MARIADB_BASE_VERSION) || MYSQL_VERSION_ID < 50709 - res = mysql_execute_command(thd); + res = mysql_execute_command(thd); #else res = mysql_execute_command(thd, false); #endif - break; - case 2: - //denied uninstall plugin - res = 1; - break; - default: - //everything else - res = trampoline_mysql_execute_command(thd); - } + break; + case 2: + // denied uninstall plugin + res = 1; + break; + default: + // everything else + res = trampoline_mysql_execute_command(thd); + } } - audit(&thd_data); - if (pThdPrintedList && pThdPrintedList->cur_index >0) - { - pThdPrintedList->cur_index --; - } - if(firstTime) - { - THDVAR(thd,is_thd_printed_list) = 0; - } - return res; + + audit(&thd_data); + + if (pThdPrintedList && pThdPrintedList->cur_index > 0) + { + pThdPrintedList->cur_index--; + } + + if (firstTime) + { + THDVAR(thd,is_thd_printed_list) = 0; + } + return res; } - #if MYSQL_VERSION_ID < 50600 -static void audit_log_slow_statement(THD * thd) +static void audit_log_slow_statement(THD *thd) { - trampoline_log_slow_statement(thd); - audit_post_execute(thd); + trampoline_log_slow_statement(thd); + audit_post_execute(thd); } #endif @@ -713,109 +741,123 @@ static int audit_check_user(THD *thd, enum enum_server_command command, const char *passwd, uint passwd_len, const char *db, bool check_count) { - int res = trampoline_check_user (thd, command, passwd, passwd_len, db, check_count); - ThdSesData ThdData (thd); - audit (&ThdData); + int res = trampoline_check_user(thd, command, passwd, passwd_len, db, check_count); + ThdSesData ThdData(thd); + + audit(&ThdData); return (res); } #elif MYSQL_VERSION_ID < 50600 -//only for 5.5 -//in 5.6: we use audit plugin event to get the login event +// only for 5.5 +// in 5.6: we use audit plugin event to get the login event static bool audit_acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_len) { - bool res = trampoline_acl_authenticate (thd, connect_errors, com_change_user_pkt_len); - ThdSesData ThdData (thd); - audit (&ThdData); + bool res = trampoline_acl_authenticate(thd, connect_errors, com_change_user_pkt_len); + ThdSesData ThdData(thd); + + audit(&ThdData); + return (res); } #endif static bool parse_thd_offsets_string (char *poffsets_string) { - - char offset_str [2048] = {0}; + char offset_str[2048] = {0}; char *poffset_str = offset_str; - strncpy (poffset_str,poffsets_string,array_elements(offset_str)); - char * comma_delimiter = strchr (poffset_str,','); - size_t i =0; - OFFSET *pOffset; - size_t len = strlen (poffset_str); - for (size_t j=0;j= '0' && poffset_str[j] <='9') || poffset_str[j] == ' ' || poffset_str[j] == ',')) + if (!((poffset_str[j] >= '0' && poffset_str[j] <= '9') || poffset_str[j] == ' ' || poffset_str[j] == ',')) + { return false; + } } - while (poffset_str !=NULL) + while (poffset_str != NULL) { - comma_delimiter = strchr (poffset_str,','); - if(comma_delimiter) - { - *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)) + comma_delimiter = strchr(poffset_str, ','); + if (comma_delimiter) { - if(sscanf (poffset_str, "%zu", pOffset) != 1) - { - sql_print_error("%s Failed parsing audit_offsets: scanf failed for offset string: \"%s\" (possible missing offset)", log_prefix, poffset_str); - return false; - } + *comma_delimiter = '\0'; } - else + + pOffset = (OFFSET *) &Audit_formatter::thd_offsets.query_id + i; + if ((size_t)pOffset- (size_t)&Audit_formatter::thd_offsets < sizeof(Audit_formatter::thd_offsets)) { - sql_print_error("%s Failed parsing audit_offsets: too many offsets specified", log_prefix); + if (sscanf(poffset_str, "%zu", pOffset) != 1) + { + sql_print_error("%s Failed parsing audit_offsets: scanf failed for offset string: \"%s\" (possible missing offset)", log_prefix, poffset_str); + return false; + } + } + else + { + sql_print_error("%s Failed parsing audit_offsets: too many offsets specified", log_prefix); return false; } + i++; - if(comma_delimiter) - { - poffset_str = comma_delimiter + 1; - } - else - { - poffset_str = NULL; - } - } - //validate that we got all offsets. If there is still space in thd_offsets then we didn't get all offsets - pOffset = (OFFSET*)&Audit_formatter::thd_offsets.query_id + i; - if ((size_t)pOffset- (size_t)&Audit_formatter::thd_offsets < sizeof (Audit_formatter::thd_offsets)) - { - sql_print_error("%s Failed parsing audit_offsets: not all offsets specified. This may happen if you used an old version of offset-extract.sh script.", log_prefix); - return false; - } + + if (comma_delimiter) + { + poffset_str = comma_delimiter + 1; + } + else + { + poffset_str = NULL; + } + } + + // validate that we got all offsets. If there is still space in thd_offsets then we didn't get all offsets + pOffset = (OFFSET*)&Audit_formatter::thd_offsets.query_id + i; + if ((size_t)pOffset- (size_t)&Audit_formatter::thd_offsets < sizeof (Audit_formatter::thd_offsets)) + { + sql_print_error("%s Failed parsing audit_offsets: not all offsets specified. This may happen if you used an old version of offset-extract.sh script.", log_prefix); + return false; + } return true; } -static bool validate_offsets(const ThdOffsets * offset) +static bool validate_offsets(const ThdOffsets *offset) { - //check that offsets are actually correct. We use a buff of memory as a dummy THD (32K is high enough) + // check that offsets are actually correct. We use a buff of memory as a dummy THD (32K is high enough) char buf[32*1024] = {0}; - THD * thd = (THD *)buf; - //sanity check that offsets match - - //we set the thread id to a value using the offset and then check that the value matches what thd_get_thread_id returns + THD *thd = (THD *)buf; + + // sanity check that offsets match + + // we set the thread id to a value using the offset and then check that the value matches what thd_get_thread_id returns const my_thread_id thread_id_test_val = 123456; (*(my_thread_id *) (((char *) thd)+ offset->thread_id)) = thread_id_test_val; - my_thread_id res= thd_get_thread_id(thd); + my_thread_id res = thd_get_thread_id(thd); if (res != thread_id_test_val) { sql_print_error( - "%s Offsets: %s (%s) match thread validation check fails with value: %lu. Skipping offest.", - log_prefix, offset->version, offset->md5digest, - (unsigned long) res); + "%s Offsets: %s (%s) match thread validation check fails with value: %lu. Skipping offest.", + log_prefix, offset->version, offset->md5digest, + (unsigned long) res); return false; } - //extended validation via security_context method - //can be disabled via: audit_validate_offsets_extended=OFF - if(validate_offsets_extended_enable) + + // extended validation via security_context method + // can be disabled via: audit_validate_offsets_extended=OFF + if (validate_offsets_extended_enable) { - const query_id_t query_id_test_val = 789; - (*(query_id_t *) (((char *) thd)+ offset->query_id)) = query_id_test_val; - Security_context * sctx = (Security_context *) (((unsigned char *) thd) + offset->main_security_ctx); - char user_test_val[] = "aud_tusr"; - if(!offset->sec_ctx_user) //use compiled header + const query_id_t query_id_test_val = 789; + (*(query_id_t *) (((char *) thd)+ offset->query_id)) = query_id_test_val; + + Security_context *sctx = (Security_context *) (((unsigned char *) thd) + offset->main_security_ctx); + char user_test_val[] = "aud_tusr"; + + if (! offset->sec_ctx_user) // use compiled header { #if defined(MARIADB_BASE_VERSION) || MYSQL_VERSION_ID < 50709 sctx->user = user_test_val; @@ -823,23 +865,24 @@ static bool validate_offsets(const ThdOffsets * offset) sctx->set_user_ptr(user_test_val, strlen(user_test_val)); #endif } - else + else { (*(const char **) (((unsigned char *) sctx) + offset->sec_ctx_user)) = user_test_val; } - char buffer[2048] = {0}; - thd_security_context(thd, buffer, 2048, 1000); - - //verfiy our buffer contains query id - if(strstr(buffer, " 789") == NULL || strstr(buffer, user_test_val) == NULL) - { - sql_print_error( - "%s Offsets: %s (%s) sec context validation check fails with value: %s. Skipping offest.", - log_prefix, offset->version, offset->md5digest, buffer); - return false; - } - sql_print_information( - "%s extended offsets validate res: %s", log_prefix, buffer); + + char buffer[2048] = {0}; + thd_security_context(thd, buffer, 2048, 1000); + + // verfiy our buffer contains query id + if (strstr(buffer, " 789") == NULL || strstr(buffer, user_test_val) == NULL) + { + sql_print_error( + "%s Offsets: %s (%s) sec context validation check fails with value: %s. Skipping offest.", + log_prefix, offset->version, offset->md5digest, buffer); + return false; + } + sql_print_information( + "%s extended offsets validate res: %s", log_prefix, buffer); } return true; } @@ -852,52 +895,56 @@ static bool validate_offsets(const ThdOffsets * offset) * * @return true on success. */ -static bool calc_file_md5(const char * file_name, char * digest_str) +static bool calc_file_md5(const char *file_name, char *digest_str) { - File fd; - unsigned char digest[16] = {0}; - bool ret = false; - if ((fd = my_open(file_name, O_RDONLY, MYF(MY_WME))) < 0) - { - sql_print_error("%s Failed file open: [%s], errno: %d.", - log_prefix, file_name, errno); - return false; - } + File fd; + unsigned char digest[16] = {0}; + bool ret = false; - my_MD5Context context; - my_MD5Init(&context); - const size_t buff_size = 16384; - unsigned char file_buff[buff_size] = {0}; + if ((fd = my_open(file_name, O_RDONLY, MYF(MY_WME))) < 0) + { + sql_print_error("%s Failed file open: [%s], errno: %d.", + log_prefix, file_name, errno); + return false; + } - ssize_t res; - do - { - res = read(fd, file_buff, buff_size); - if(res > 0) - { - my_MD5Update(&context, file_buff, res); - } + my_MD5Context context; + my_MD5Init(&context); + const size_t buff_size = 16384; + unsigned char file_buff[buff_size] = {0}; + + ssize_t res; + do + { + res = read(fd, file_buff, buff_size); + if (res > 0) + { + my_MD5Update(&context, file_buff, res); + } } - while(res > 0); - if(res == 0) //reached end of file - { - my_MD5Final(digest, &context); - ret = true; - } - else - { - sql_print_error("%s Failed program read. res: %zd, errno: %d.", - log_prefix, res, errno); - } - (void) my_close(fd, MYF(0)); - if(ret) //we got the digest - { - for (int j = 0; j < 16; j++) - { - sprintf(&(digest_str[j * 2]), "%02x", digest[j]); - } - } - return ret; + while (res > 0); + + if (res == 0) // reached end of file + { + my_MD5Final(digest, &context); + ret = true; + } + else + { + sql_print_error("%s Failed program read. res: %zd, errno: %d.", + log_prefix, res, errno); + } + + (void) my_close(fd, MYF(0)); + + if (ret) // we got the digest + { + for (int j = 0; j < 16; j++) + { + sprintf(&(digest_str[j * 2]), "%02x", digest[j]); + } + } + return ret; } /** @@ -907,60 +954,61 @@ static bool calc_file_md5(const char * file_name, char * digest_str) */ static int setup_offsets() { - DBUG_ENTER("setup_offsets"); + DBUG_ENTER("setup_offsets"); sql_print_information ("%s setup_offsets audit_offsets: %s validate_checksum: %d offsets_by_version: %d", - log_prefix, offsets_string, validate_checksum_enable, offsets_by_version_enable); + log_prefix, offsets_string, validate_checksum_enable, offsets_by_version_enable); - char digest_str [128] = {0}; - const ThdOffsets * offset; + char digest_str[128] = {0}; + const ThdOffsets *offset; - //setup digest_str to contain the md5sum in hex + // setup digest_str to contain the md5sum in hex calc_file_md5(my_progname, digest_str); - sql_print_information( - "%s mysqld: %s (%s) ", log_prefix, my_progname, digest_str); + sql_print_information( + "%s mysqld: %s (%s) ", log_prefix, my_progname, digest_str); - //if present in my.cnf - //[mysqld] - //audit_validate_checksum=1 - // or if - //audit_checksum=0f4d7e3b17eb36f17aafe4360993a769 - //if (validate_checksum_enable || (checksum_string != NULL && strlen(checksum_string) > 0)) - //{ + // if present in my.cnf + // [mysqld] + // audit_validate_checksum=1 + // or if + // audit_checksum=0f4d7e3b17eb36f17aafe4360993a769 + // if (validate_checksum_enable || (checksum_string != NULL && strlen(checksum_string) > 0)) + // { - //if present the offset_string specified in my.cnf - //[mysqld] - //audit_offsets=6200, 6264, 3672, 3944, 88, 2048 + // if present the offset_string specified in my.cnf + // [mysqld] + // audit_offsets=6200, 6264, 3672, 3944, 88, 2048 if (offsets_string != NULL) - { - if (checksum_string != NULL && strlen(checksum_string) > 0) - { - if (strncasecmp(checksum_string, digest_str, 32)) - { - sql_print_information( - "%s checksum check failed for %s, but found %s", - log_prefix, checksum_string, digest_str); - DBUG_RETURN(1); - } - } - if (parse_thd_offsets_string (offsets_string)) + { + if (checksum_string != NULL && strlen(checksum_string) > 0) + { + if (strncasecmp(checksum_string, digest_str, 32)) + { + sql_print_information( + "%s checksum check failed for %s, but found %s", + log_prefix, checksum_string, digest_str); + DBUG_RETURN(1); + } + } + + if (parse_thd_offsets_string (offsets_string)) { sql_print_information ("%s setup_offsets Audit_formatter::thd_offsets values: %zu %zu %zu %zu %zu %zu %zu %zu %zu %zu %zu %zu", log_prefix, - Audit_formatter::thd_offsets.query_id, - Audit_formatter::thd_offsets.thread_id, - Audit_formatter::thd_offsets.main_security_ctx, - Audit_formatter::thd_offsets.command, - Audit_formatter::thd_offsets.lex, - Audit_formatter::thd_offsets.lex_comment, - Audit_formatter::thd_offsets.sec_ctx_user, - Audit_formatter::thd_offsets.sec_ctx_host, - Audit_formatter::thd_offsets.sec_ctx_ip, - Audit_formatter::thd_offsets.sec_ctx_priv_user, - Audit_formatter::thd_offsets.db, - Audit_formatter::thd_offsets.killed); + Audit_formatter::thd_offsets.query_id, + Audit_formatter::thd_offsets.thread_id, + Audit_formatter::thd_offsets.main_security_ctx, + Audit_formatter::thd_offsets.command, + Audit_formatter::thd_offsets.lex, + Audit_formatter::thd_offsets.lex_comment, + Audit_formatter::thd_offsets.sec_ctx_user, + Audit_formatter::thd_offsets.sec_ctx_host, + Audit_formatter::thd_offsets.sec_ctx_ip, + Audit_formatter::thd_offsets.sec_ctx_priv_user, + Audit_formatter::thd_offsets.db, + Audit_formatter::thd_offsets.killed); - if (!validate_offsets(&Audit_formatter::thd_offsets)) + if (! validate_offsets(&Audit_formatter::thd_offsets)) { sql_print_error("%s Offsets set didn't pass validation. audit_offsets: %s .", log_prefix, offsets_string); DBUG_RETURN(1); @@ -971,297 +1019,316 @@ static int setup_offsets() sql_print_error("%s Failed parsing audit_offsets: %s", log_prefix, offsets_string); DBUG_RETURN(1); } + sql_print_information ("%s Validation passed. Using offsets from audit_offsets: %s",log_prefix, offsets_string); DBUG_RETURN(0); - //exit from function + // exit from function } - - size_t arr_size = thd_offsets_arr_size; - //iterate and search for the first offset which matches our checksum - if(validate_checksum_enable && strlen(digest_str) > 0) - { - for(size_t i=0; i < arr_size; i++) - { - offset = thd_offsets_arr + i; - if (strlen(offset->md5digest) >0) - { - if (!strncasecmp(digest_str, offset->md5digest, 32)) - { - sql_print_information("%s Checksum verified. Using offsets from offset version: %s (%s)", log_prefix, offset->version, digest_str); - Audit_formatter::thd_offsets = *offset; - DBUG_RETURN(0); - //return - } - } - } - } - if(offsets_by_version_enable) - { - bool server_is_ndb = strstr(server_version, "ndb") != NULL; - for(size_t i=0; i < arr_size; i++) - { - offset = thd_offsets_arr + i; - const char * version = offset->version; - bool version_is_ndb = strstr(offset->version, "ndb") != NULL; - const char * dash = strchr(version, '-'); - char version_stripped[16] = {0}; - if(dash) //we use the version string up to the '-' - { - size_t tocopy = dash - version; - if(tocopy > 15) tocopy = 15; //sanity - strncpy(version_stripped, version, tocopy); - version = version_stripped; - } - if(strstr(server_version, version)) - { - if(server_is_ndb == version_is_ndb) - { - if (validate_offsets(offset)) - { - sql_print_information("%s Using offsets from offset version: %s (%s)", log_prefix, offset->version, offset->md5digest); - Audit_formatter::thd_offsets = *offset; - DBUG_RETURN(0); - } - else - { - //try doing 24 byte decrement on THD offsets. Seen that on Ubuntu/Debian this is valid. On 5.6 this is 16 bytes. - #if MYSQL_VERSION_ID < 50600 - OFFSET dec = 24; - #else - OFFSET dec = 16; - #endif - ThdOffsets decoffsets = *offset; - decoffsets.query_id -= dec; - decoffsets.thread_id -= dec; - decoffsets.main_security_ctx -= dec; - decoffsets.command -= dec; - if (validate_offsets(&decoffsets)) - { - Audit_formatter::thd_offsets = decoffsets; - sql_print_information("%s Using decrement (%zu) offsets from offset version: %s (%s) values: %zu %zu %zu %zu %zu %zu %zu %zu %zu %zu", - log_prefix, dec, offset->version, offset->md5digest, - Audit_formatter::thd_offsets.query_id, - Audit_formatter::thd_offsets.thread_id, - Audit_formatter::thd_offsets.main_security_ctx, - Audit_formatter::thd_offsets.command, - Audit_formatter::thd_offsets.lex, - Audit_formatter::thd_offsets.lex_comment, + + size_t arr_size = thd_offsets_arr_size; + // iterate and search for the first offset which matches our checksum + if (validate_checksum_enable && strlen(digest_str) > 0) + { + for (size_t i=0; i < arr_size; i++) + { + offset = thd_offsets_arr + i; + if (strlen(offset->md5digest) > 0) + { + if (strncasecmp(digest_str, offset->md5digest, 32) == 0) + { + sql_print_information("%s Checksum verified. Using offsets from offset version: %s (%s)", log_prefix, offset->version, digest_str); + Audit_formatter::thd_offsets = *offset; + DBUG_RETURN(0); + // return + } + } + } + } + + if (offsets_by_version_enable) + { + bool server_is_ndb = strstr(server_version, "ndb") != NULL; + for (size_t i=0; i < arr_size; i++) + { + offset = thd_offsets_arr + i; + const char *version = offset->version; + bool version_is_ndb = strstr(offset->version, "ndb") != NULL; + const char * dash = strchr(version, '-'); + char version_stripped[16] = {0}; + if (dash) // we use the version string up to the '-' + { + size_t tocopy = dash - version; + if (tocopy > 15) + tocopy = 15; // sanity + strncpy(version_stripped, version, tocopy); + version = version_stripped; + } + + if (strstr(server_version, version)) + { + if (server_is_ndb == version_is_ndb) + { + if (validate_offsets(offset)) + { + sql_print_information("%s Using offsets from offset version: %s (%s)", log_prefix, offset->version, offset->md5digest); + Audit_formatter::thd_offsets = *offset; + DBUG_RETURN(0); + } + else + { + // try doing 24 byte decrement on THD offsets. + // Seen that on Ubuntu/Debian this is valid. On 5.6 this is 16 bytes. +#if MYSQL_VERSION_ID < 50600 + OFFSET dec = 24; +#else + OFFSET dec = 16; +#endif + ThdOffsets decoffsets = *offset; + decoffsets.query_id -= dec; + decoffsets.thread_id -= dec; + decoffsets.main_security_ctx -= dec; + decoffsets.command -= dec; + if (validate_offsets(&decoffsets)) + { + Audit_formatter::thd_offsets = decoffsets; + sql_print_information("%s Using decrement (%zu) offsets from offset version: %s (%s) values: %zu %zu %zu %zu %zu %zu %zu %zu %zu %zu", + log_prefix, dec, offset->version, offset->md5digest, + Audit_formatter::thd_offsets.query_id, + Audit_formatter::thd_offsets.thread_id, + Audit_formatter::thd_offsets.main_security_ctx, + Audit_formatter::thd_offsets.command, + Audit_formatter::thd_offsets.lex, + Audit_formatter::thd_offsets.lex_comment, + Audit_formatter::thd_offsets.sec_ctx_user, + Audit_formatter::thd_offsets.sec_ctx_host, + Audit_formatter::thd_offsets.sec_ctx_ip, + Audit_formatter::thd_offsets.sec_ctx_priv_user); + + DBUG_RETURN(0); + } + } + } // ndb check +#if defined(__x86_64__) && MYSQL_VERSION_ID > 50505 + else if (server_is_ndb) + { + // in 64bit 5.5 we've seen ndb has an offset of 32 on first 2 values + OFFSET inc = 32; + ThdOffsets incoffsets = *offset; + incoffsets.query_id += inc; + incoffsets.thread_id += inc; + if (validate_offsets(&incoffsets)) + { + Audit_formatter::thd_offsets = incoffsets; + sql_print_information("%s Using increment (%zu) offsets from offset version: %s (%s) values: %zu %zu %zu %zu %zu %zu %zu %zu %zu %zu", + log_prefix, inc, offset->version, offset->md5digest, + Audit_formatter::thd_offsets.query_id, + Audit_formatter::thd_offsets.thread_id, + Audit_formatter::thd_offsets.main_security_ctx, + Audit_formatter::thd_offsets.command, + Audit_formatter::thd_offsets.lex, + Audit_formatter::thd_offsets.lex_comment, Audit_formatter::thd_offsets.sec_ctx_user, Audit_formatter::thd_offsets.sec_ctx_host, Audit_formatter::thd_offsets.sec_ctx_ip, Audit_formatter::thd_offsets.sec_ctx_priv_user); - - DBUG_RETURN(0); - } - } - }//ndb check -#if defined(__x86_64__) && MYSQL_VERSION_ID > 50505 - else if(server_is_ndb) - { - //in 64bit 5.5 we've seen ndb has an offset of 32 on first 2 values - OFFSET inc = 32; - ThdOffsets incoffsets = *offset; - incoffsets.query_id += inc; - incoffsets.thread_id += inc; - if (validate_offsets(&incoffsets)) - { - Audit_formatter::thd_offsets = incoffsets; - sql_print_information("%s Using increment (%zu) offsets from offset version: %s (%s) values: %zu %zu %zu %zu %zu %zu %zu %zu %zu %zu", - log_prefix, inc, offset->version, offset->md5digest, - Audit_formatter::thd_offsets.query_id, - Audit_formatter::thd_offsets.thread_id, - Audit_formatter::thd_offsets.main_security_ctx, - Audit_formatter::thd_offsets.command, - Audit_formatter::thd_offsets.lex, - Audit_formatter::thd_offsets.lex_comment, - Audit_formatter::thd_offsets.sec_ctx_user, - Audit_formatter::thd_offsets.sec_ctx_host, - Audit_formatter::thd_offsets.sec_ctx_ip, - Audit_formatter::thd_offsets.sec_ctx_priv_user); - DBUG_RETURN(0); - } - } + DBUG_RETURN(0); + } + } #endif - } - } - } - - sql_print_information("%s Couldn't find proper THD offsets for: %s", log_prefix, server_version); - DBUG_RETURN(1); + } + } + } + + sql_print_information("%s Couldn't find proper THD offsets for: %s", log_prefix, server_version); + DBUG_RETURN(1); } -const char * retrieve_command (THD * thd, bool & is_sql_cmd) +const char *retrieve_command(THD *thd, bool &is_sql_cmd) { - const char *cmd = NULL; + const char *cmd = NULL; is_sql_cmd = false; - int command = Audit_formatter::thd_inst_command(thd); - if (command < 0 || command > COM_END) - { - command = COM_END; - } - //check if from query cache. If so set to select and return - if(THDVAR(thd, query_cache_table_list) != 0) - { - return "select"; - } - const int sql_command = thd_sql_command(thd); + int command = Audit_formatter::thd_inst_command(thd); + if (command < 0 || command > COM_END) + { + command = COM_END; + } + + // check if from query cache. If so set to select and return + if (THDVAR(thd, query_cache_table_list) != 0) + { + return "select"; + } + + const int sql_command = thd_sql_command(thd); #if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100108 - if (command == COM_QUERY && sql_command >= 0 && sql_command < SQLCOM_END) + if (command == COM_QUERY && sql_command >= 0 && sql_command < SQLCOM_END) #else - if (sql_command >=0 && sql_command < MAX_COM_STATUS_VARS_RECORDS ) + if (sql_command >=0 && sql_command < MAX_COM_STATUS_VARS_RECORDS ) #endif - { - is_sql_cmd = true; - cmd = com_status_vars_array[sql_command].name; - } - if(!cmd) - { - cmd = command_name[command].str; - } - const char * user = Audit_formatter::thd_inst_main_security_ctx_user(thd); - const char * priv_user = Audit_formatter::thd_inst_main_security_ctx_priv_user(thd); - if (strcmp (cmd, "Connect") ==0 && ((user && strcmp(user, "event_scheduler") != 0) && (priv_user == NULL || *priv_user == 0x0))) - { - cmd = "Failed Login"; - } - return cmd; + { + is_sql_cmd = true; + cmd = com_status_vars_array[sql_command].name; + } + + if (! cmd) + { + cmd = command_name[command].str; + } + + const char *user = Audit_formatter::thd_inst_main_security_ctx_user(thd); + const char *priv_user = Audit_formatter::thd_inst_main_security_ctx_priv_user(thd); + if (strcmp(cmd, "Connect") == 0 && + ((user && strcmp(user, "event_scheduler") != 0) && + (priv_user == NULL || *priv_user == 0x0))) + { + cmd = "Failed Login"; + } + return cmd; } -static int set_com_status_vars_array () +static int set_com_status_vars_array() { - DBUG_ENTER("set_com_status_vars_array"); - 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) - { - com_status_vars = (SHOW_VAR*)status_vars[sv_idx].value; - int status_vars_index =0; - //we use "select" as 0 offset (SQLCOM_SELECT=0) + DBUG_ENTER("set_com_status_vars_array"); + SHOW_VAR *com_status_vars; + int sv_idx = 0; - while(strcmp(com_status_vars[status_vars_index].name,"select") !=0 && com_status_vars[status_vars_index].name != NullS) - { - status_vars_index ++; - } - if(strcmp(com_status_vars[status_vars_index].name,"select") !=0) - { - sql_print_error("%s Failed finding 'select' index in com_status_vars: [%p]. Plugin Init failed.", - log_prefix, com_status_vars); - DBUG_RETURN (1); - } - size_t initial_offset = (size_t) com_status_vars[status_vars_index].value; - status_vars_index =0; - while (com_status_vars[status_vars_index].name != NullS) - { - int sql_command_idx = ((size_t)(com_status_vars[status_vars_index].value) - (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; - } - status_vars_index ++; - } - sql_print_information("%s Done initializing sql command names. status_vars_index: [%d], com_status_vars: [%p].", - log_prefix, status_vars_index, com_status_vars); - } - else - { - sql_print_error("%s Failed looking up 'Com' entry in status_vars. Plugin Init failed.", - log_prefix); - DBUG_RETURN (1); - } - DBUG_RETURN (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) + { + com_status_vars = (SHOW_VAR *) status_vars[sv_idx].value; + int status_vars_index = 0; + // we use "select" as 0 offset (SQLCOM_SELECT=0) + + while (strcmp(com_status_vars[status_vars_index].name,"select") != 0 && com_status_vars[status_vars_index].name != NullS) + { + status_vars_index++; + } + + if (strcmp(com_status_vars[status_vars_index].name,"select") != 0) + { + sql_print_error("%s Failed finding 'select' index in com_status_vars: [%p]. Plugin Init failed.", + log_prefix, com_status_vars); + DBUG_RETURN (1); + } + + size_t initial_offset = (size_t) com_status_vars[status_vars_index].value; + status_vars_index = 0; + + while (com_status_vars[status_vars_index].name != NullS) + { + int sql_command_idx = ((size_t)(com_status_vars[status_vars_index].value) - (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; + } + status_vars_index++; + } + sql_print_information("%s Done initializing sql command names. status_vars_index: [%d], com_status_vars: [%p].", + log_prefix, status_vars_index, com_status_vars); + } + else + { + sql_print_error("%s Failed looking up 'Com' entry in status_vars. Plugin Init failed.", + log_prefix); + DBUG_RETURN (1); + } + DBUG_RETURN (0); } -static int string_to_array(const void *save, void *array, - int rows, int length) + +static int string_to_array(const void *save, void *array, int rows, int length) { - const char* save_string; - save_string = *static_cast (save); - char* string_array; - string_array = (char *) array; - int r = 0; - if (save_string != NULL) - { - int p = 0; - int last_char=0; //points to the index after last non-whitespace char (used to trim whitespace at end) - for (int i = 0; save_string[i] != '\0'; i++) - { + const char *save_string; + save_string = *static_cast (save); + char *string_array; + string_array = (char *) array; + int r = 0; + + if (save_string != NULL) + { + int p = 0; + int last_char = 0; // points to the index after last non-whitespace char (used to trim whitespace at end) + for (int i = 0; save_string[i] != '\0'; i++) + { if (0 == p && isspace(save_string[i])) { - //leading white space. trim it out + // leading white space. trim it out continue; } - if (save_string[i] == ',') - { - if (p > 0) - { - string_array[r * length + last_char] = '\0'; + if (save_string[i] == ',') + { + if (p > 0) + { + string_array[r * length + last_char] = '\0'; last_char = 0; - p = 0; - r++; - if (r == (rows - 1)) - { - break; - } - } - } - else - { - string_array[r * length + p] = tolower(save_string[i]); - p++; - if(!isspace(save_string[i])) + p = 0; + r++; + if (r == (rows - 1)) + { + break; + } + } + } + else + { + string_array[r * length + p] = tolower(save_string[i]); + p++; + if (!isspace(save_string[i])) { last_char = p; } - } - } - if (last_char > 0) - { - string_array[r * length + last_char] = '\0'; - r++; - } - string_array[r * length + 0] = '\0'; - } - return r; + } + } + if (last_char > 0) + { + string_array[r * length + last_char] = '\0'; + r++; + } + string_array[r * length + 0] = '\0'; + } + return r; } __attribute__ ((noinline)) static void trampoline_dummy_func_for_mem() { TRAMPOLINE_NOP_DEF } -//holds memory used for trampoline -static void * trampoline_mem = NULL; -//pointer to current free mem -static void * trampoline_mem_free = NULL; + +// holds memory used for trampoline +static void *trampoline_mem = NULL; + +// pointer to current free mem +static void *trampoline_mem_free = NULL; /** - * Utility method for hot patching + * Utility method for hot patching */ -static int do_hot_patch(void ** trampoline_func_pp, unsigned int * trampoline_size, +static int do_hot_patch(void ** trampoline_func_pp, unsigned int * trampoline_size, void* target_function, void* audit_function, const char * func_name) { - //16 byte align the pointer + // 16 byte align the pointer DATATYPE_ADDRESS addrs = (DATATYPE_ADDRESS)trampoline_mem_free + 15; - *trampoline_func_pp = (void*)(addrs & ~0x0F); - //hot patch functions - - int res = hot_patch_function(target_function, audit_function, - *trampoline_func_pp, trampoline_size, true); - if (res != 0) - { - //hot patch failed. - sql_print_error("%s unable to hot patch %s (%p). res: %d.", - log_prefix, func_name, target_function, res); - return 1; - } - sql_print_information( - "%s hot patch for: %s (%p) complete. Audit func: %p, Trampoline address: %p size: %u.", - log_prefix, func_name, target_function, audit_function, *trampoline_func_pp, *trampoline_size); + *trampoline_func_pp = (void*)(addrs & ~0x0F); + + // hot patch functions + int res = hot_patch_function(target_function, audit_function, + *trampoline_func_pp, trampoline_size, true); + if (res != 0) + { + // hot patch failed. + sql_print_error("%s unable to hot patch %s (%p). res: %d.", + log_prefix, func_name, target_function, res); + return 1; + } + sql_print_information( + "%s hot patch for: %s (%p) complete. Audit func: %p, Trampoline address: %p size: %u.", + log_prefix, func_name, target_function, audit_function, *trampoline_func_pp, *trampoline_size); trampoline_mem_free = (void *)(((DATATYPE_ADDRESS)*trampoline_func_pp) + *trampoline_size + jump_size()); return 0; } @@ -1293,7 +1360,7 @@ DECLARE_STRING_ARR_UPDATE_FUNC(record_objs) static void password_masking_regex_string_update(THD *thd, struct st_mysql_sys_var *var, void *tgt, const void *save) { - const char * str_val = ""; + const char *str_val = ""; char *const* save_p = static_cast(save); // if got a null pointer or empty string, use "" @@ -1305,8 +1372,8 @@ static void password_masking_regex_string_update(THD *thd, struct st_mysql_sys_v // if a string value supplied, check that it compiles if (*str_val) { - int res = json_formatter.compile_password_masking_regex(str_val); - if (res != 0) // fails compilation + bool res = json_formatter.compile_password_masking_regex(str_val); + if (! res) // fails compilation { // copy in default pw strncpy(password_masking_regex_buff, default_pw_masking_regex, array_elements(password_masking_regex_buff) - 1); @@ -1320,11 +1387,11 @@ static void password_masking_regex_string_update(THD *thd, struct st_mysql_sys_v if (str_val != password_masking_regex_buff) { strncpy(password_masking_regex_buff, str_val, array_elements(password_masking_regex_buff) - 1); - } + } password_masking_regex_string = password_masking_regex_buff; // it was already compiled, don't need to do it again } - sql_print_information("%s Compile password_masking_regex res: [%d]", log_prefix, res); + sql_print_information("%s Compile password_masking_regex res: [%d]", log_prefix, res); } else { @@ -1337,12 +1404,12 @@ static void password_masking_regex_string_update(THD *thd, struct st_mysql_sys_v sql_print_information("%s Set password_masking_regex value: [%s]", log_prefix, str_val); } -static void replace_char(char * str, const char tofind, const char rplc) +static void replace_char(char *str, const char tofind, const char rplc) { size_t n = strlen(str); - for(size_t i = 0; i< n; i++) + for (size_t i = 0; i< n; i++) { - if(tofind == str[i]) + if (tofind == str[i]) { str[i] = rplc; } @@ -1351,7 +1418,7 @@ static void replace_char(char * str, const char tofind, const char rplc) static void json_socket_name_update(THD *thd, struct st_mysql_sys_var *var, void *tgt, const void *save) { - const char * str_val = NULL; + const char *str_val = NULL; char *const* save_p = static_cast(save); if (save_p != NULL && *save_p != NULL) @@ -1359,38 +1426,41 @@ static void json_socket_name_update(THD *thd, struct st_mysql_sys_var *var, void str_val = *save_p; } - const char * str = str_val; + const char *str = str_val; const size_t buff_len = array_elements( json_socket_name_buff) -1; - //copy str to buffer only if str is not pointing to buff - if(NULL == str) + // copy str to buffer only if str is not pointing to buff + if (NULL == str) { json_socket_name_buff[0] = '\0'; } - else if(str != json_socket_name_buff) + else if (str != json_socket_name_buff) { strncpy( json_socket_name_buff , str, buff_len); } - if(strlen(json_socket_name_buff) == 0 && (mysqld_port > 0 || mysqld_unix_port)) //set default + if (strlen(json_socket_name_buff) == 0 && (mysqld_port > 0 || mysqld_unix_port)) // set default { - const char * name_prefix = "/tmp/mysql.audit_"; - - size_t indx = strlen(name_prefix); //count how much to move forward the buff - strncpy( json_socket_name_buff, name_prefix, buff_len); + const char *name_prefix = "/tmp/mysql.audit_"; + + size_t indx = strlen(name_prefix); // count how much to move forward the buff + strncpy(json_socket_name_buff, name_prefix, buff_len); + char cwd_buff[512] = {0}; my_getwd(cwd_buff, array_elements(cwd_buff) - 1, 0); replace_char(cwd_buff, '/', '_'); size_t cwd_len = strlen(cwd_buff); - if(cwd_len > 0 && '_' != cwd_buff[cwd_len-1]) //add _ to end + + if (cwd_len > 0 && '_' != cwd_buff[cwd_len-1]) // add _ to end { - strncpy(cwd_buff + cwd_len, "_", array_elements(cwd_buff) - 1 - cwd_len); + strncpy(cwd_buff + cwd_len, "_", array_elements(cwd_buff) - 1 - cwd_len); } strncpy(json_socket_name_buff + indx, cwd_buff, buff_len - indx); indx += cwd_len; - if(indx < buff_len) + + if (indx < buff_len) { - if(mysqld_port > 0) + if (mysqld_port > 0) { - snprintf(json_socket_name_buff + indx, buff_len - indx, "%u", mysqld_port); + snprintf(json_socket_name_buff + indx, buff_len - indx, "%u", mysqld_port); } else { @@ -1398,29 +1468,29 @@ static void json_socket_name_update(THD *thd, struct st_mysql_sys_var *var, void replace_char(json_socket_name_buff + indx, '/', '_'); } } - else //should never happen + else // should never happen { sql_print_error("%s json_socket_name_buff not big enough to set default name. buff: %s", - log_prefix, json_socket_name_buff); - } + log_prefix, json_socket_name_buff); + } } - json_socket_handler.m_io_dest = json_socket_name_buff; + json_socket_handler.m_io_dest = json_socket_name_buff; sql_print_information("%s Set json_socket_name str: [%s] value: [%s]", log_prefix, str, json_socket_handler.m_io_dest); } -//check that the regex compiles. Return 0 on success. -static int password_masking_regex_check(THD* thd, struct st_mysql_sys_var * var, void* save, st_mysql_value* value) +// check that the regex compiles. Return 0 on success. +static int password_masking_regex_check(THD *thd, struct st_mysql_sys_var *var, void *save, st_mysql_value *value) { - int length= array_elements(password_masking_regex_check_buff); - const char * str = value->val_str(value, password_masking_regex_check_buff, &length); - *(const char**)save= str; - if(NULL == str || str[0] == '\0') //empty string is fine (means disabled) + int length = array_elements(password_masking_regex_check_buff); + const char *str = value->val_str(value, password_masking_regex_check_buff, &length); + *(const char**)save = str; + if (NULL == str || str[0] == '\0') // empty string is fine (means disabled) { return 0; } int res = 1; - pcre * preg = Audit_json_formatter::regex_compile(str); - if(preg) + pcre *preg = Audit_json_formatter::regex_compile(str); + if (preg) { res = 0; } @@ -1428,11 +1498,11 @@ static int password_masking_regex_check(THD* thd, struct st_mysql_sys_var * var, return res; } -//extended method to set also record_empty_objs_set +// extended method to set also record_empty_objs_set static void record_objs_string_update_extended(THD *thd, struct st_mysql_sys_var *var, void *tgt, const void *save) { record_objs_string_update(thd, var, tgt, save); - if(num_record_objs > 0) //check if to record also the empty set of objects + if (num_record_objs > 0) // check if to record also the empty set of objects { const char *objects[] = {"{}", NULL}; record_empty_objs_set = check_array(objects, (const char *) record_objs_array, sizeof(record_objs_array[0])); @@ -1444,111 +1514,118 @@ static void record_objs_string_update_extended(THD *thd, struct st_mysql_sys_var sql_print_information("%s Set record_empty_objs: %d", log_prefix, record_empty_objs_set); } - /* - Initialize the plugin installation. - - SYNOPSIS - audit_plugin_init() - - RETURN VALUE - 0 success - 1 failure + * Initialize the plugin installation. + * + * SYNOPSIS + * audit_plugin_init() + * + * RETURN VALUE + * 0 success + * 1 failure */ - static int audit_plugin_init(void *p) +static int audit_plugin_init(void *p) { - DBUG_ENTER("audit_plugin_init"); - - #ifdef __x86_64__ - const char * arch = "64bit"; - #else - const char * arch = "32bit"; - #endif - + DBUG_ENTER("audit_plugin_init"); + +#ifdef __x86_64__ + const char * arch = "64bit"; +#else + const char * arch = "32bit"; +#endif + int interface_ver = audit_plugin.interface_version ; #if MYSQL_VERSION_ID < 50600 - interface_ver = interface_ver >> 8; + interface_ver = interface_ver >> 8; #endif - sql_print_information( - "%s starting up. Version: %s , Revision: %s (%s). AUDIT plugin interface version: %d (0x%x). MySQL Server version: %s.", - log_prefix, MYSQL_AUDIT_PLUGIN_VERSION, - MYSQL_AUDIT_PLUGIN_REVISION, arch, interface_ver, interface_ver, - server_version); - //setup our offsets. + sql_print_information( + "%s starting up. Version: %s , Revision: %s (%s). AUDIT plugin interface version: %d (0x%x). MySQL Server version: %s.", + log_prefix, MYSQL_AUDIT_PLUGIN_VERSION, + MYSQL_AUDIT_PLUGIN_REVISION, arch, interface_ver, interface_ver, + server_version); + // setup our offsets. - if(setup_offsets() != 0) - { - DBUG_RETURN(1); - } - if (delay_cmds_string != NULL) { - delay_cmds_string_update(NULL, NULL, NULL, &delay_cmds_string); - } - if (whitelist_cmds_string != NULL) { - whitelist_cmds_string_update(NULL, NULL, NULL, &whitelist_cmds_string); - } - if (record_cmds_string != NULL) { - record_cmds_string_update(NULL, NULL, NULL, &record_cmds_string); - } - if (whitelist_users_string != NULL) { - whitelist_users_string_update(NULL, NULL, NULL, &whitelist_users_string); - } - if (record_objs_string != NULL) { - record_objs_string_update_extended(NULL, NULL, NULL, &record_objs_string); - } - if (NULL != password_masking_cmds_string) { - password_masking_cmds_string_update(NULL, NULL, NULL, &password_masking_cmds_string); - } - if (NULL != password_masking_regex_string) { - password_masking_regex_string_update(NULL, NULL, NULL, &password_masking_regex_string); - } - //update to generate the default if needed - json_socket_name_update(NULL, NULL, NULL, &(json_socket_handler.m_io_dest)); - - //set the password masking callback for json formatters - json_formatter.m_perform_password_masking = check_do_password_masking; - - //setup audit handlers (initially disabled) - int res = json_file_handler.init(&json_formatter); - if (res != 0) - { - sql_print_error( - "%s unable to init json file handler. res: %d. Aborting.", - log_prefix, res); - DBUG_RETURN(1); - } - res = json_socket_handler.init(&json_formatter); - if (res != 0) - { - sql_print_error( - "%s unable to init json socket handler. res: %d. Aborting.", - log_prefix, res); - DBUG_RETURN(1); - } - //enable according to what we have in *file_handler_enable (this is set accordingly by sysvar functionality) - json_file_handler.set_enable(json_file_handler_enable); - json_socket_handler.set_enable(json_socket_handler_enable); - Audit_handler::m_audit_handler_list[Audit_handler::JSON_FILE_HANDLER] - = &json_file_handler; - Audit_handler::m_audit_handler_list[Audit_handler::JSON_SOCKET_HANDLER] - = &json_socket_handler; - - //align our trampoline mem on its own page + if (setup_offsets() != 0) + { + DBUG_RETURN(1); + } + if (delay_cmds_string != NULL) + { + delay_cmds_string_update(NULL, NULL, NULL, &delay_cmds_string); + } + if (whitelist_cmds_string != NULL) + { + whitelist_cmds_string_update(NULL, NULL, NULL, &whitelist_cmds_string); + } + if (record_cmds_string != NULL) + { + record_cmds_string_update(NULL, NULL, NULL, &record_cmds_string); + } + if (whitelist_users_string != NULL) + { + whitelist_users_string_update(NULL, NULL, NULL, &whitelist_users_string); + } + if (record_objs_string != NULL) + { + record_objs_string_update_extended(NULL, NULL, NULL, &record_objs_string); + } + if (NULL != password_masking_cmds_string) + { + password_masking_cmds_string_update(NULL, NULL, NULL, &password_masking_cmds_string); + } + if (NULL != password_masking_regex_string) + { + password_masking_regex_string_update(NULL, NULL, NULL, &password_masking_regex_string); + } + + // update to generate the default if needed + json_socket_name_update(NULL, NULL, NULL, &(json_socket_handler.m_io_dest)); + + // set the password masking callback for json formatters + json_formatter.m_perform_password_masking = check_do_password_masking; + + // setup audit handlers (initially disabled) + int res = json_file_handler.init(&json_formatter); + if (res != 0) + { + sql_print_error( + "%s unable to init json file handler. res: %d. Aborting.", + log_prefix, res); + DBUG_RETURN(1); + } + + res = json_socket_handler.init(&json_formatter); + if (res != 0) + { + sql_print_error( + "%s unable to init json socket handler. res: %d. Aborting.", + log_prefix, res); + DBUG_RETURN(1); + } + + // enable according to what we have in *file_handler_enable (this is set accordingly by sysvar functionality) + json_file_handler.set_enable(json_file_handler_enable); + json_socket_handler.set_enable(json_socket_handler_enable); + Audit_handler::m_audit_handler_list[Audit_handler::JSON_FILE_HANDLER] = &json_file_handler; + Audit_handler::m_audit_handler_list[Audit_handler::JSON_SOCKET_HANDLER] = &json_socket_handler; + + // align our trampoline mem on its own page const unsigned long page_size = GETPAGESIZE(); const unsigned long std_page_size = 4096; - if(page_size <= std_page_size) + if (page_size <= std_page_size) { - //use static executable memory we alocated via trampoline_dummy_func_for_mem - DATATYPE_ADDRESS addrs = (DATATYPE_ADDRESS)trampoline_dummy_func_for_mem + (page_size - 1); + // use static executable memory we alocated via trampoline_dummy_func_for_mem + DATATYPE_ADDRESS addrs = (DATATYPE_ADDRESS)trampoline_dummy_func_for_mem + (page_size - 1); trampoline_mem = (void*)(addrs & ~(page_size - 1)); sql_print_information( "%s mem func addr: %p mem start addr: %p page size: %ld", log_prefix, trampoline_dummy_func_for_mem, trampoline_mem, page_size); } - else //big pages for some reason. allocate mem using mmap - { + else // big pages for some reason. allocate mem using mmap + { trampoline_mem = mmap(NULL, page_size, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); - if(MAP_FAILED == trampoline_mem) + if (MAP_FAILED == trampoline_mem) { sql_print_error("%s unable to mmap memory size: %lu, errno: %d. Aborting.", log_prefix, page_size, errno); @@ -1557,108 +1634,109 @@ static void record_objs_string_update_extended(THD *thd, struct st_mysql_sys_var else { sql_print_information( - "%s mem via mmap: %p page size: %ld", log_prefix, trampoline_mem, page_size); + "%s mem via mmap: %p page size: %ld", log_prefix, trampoline_mem, page_size); } } trampoline_mem_free = trampoline_mem; - //hot patch stuff + + // hot patch stuff void * target_function = NULL; - + #if defined(MARIADB_BASE_VERSION) || MYSQL_VERSION_ID < 50709 target_function = (void*) mysql_execute_command; #else target_function = (void*) (int (*)(THD *thd, bool first_level)) &mysql_execute_command; #endif - if(do_hot_patch((void **)&trampoline_mysql_execute_command, &trampoline_mysql_execute_size, - target_function, (void *)audit_mysql_execute_command, "mysql_execute_command")) + + if (do_hot_patch((void **)&trampoline_mysql_execute_command, &trampoline_mysql_execute_size, + target_function, (void *)audit_mysql_execute_command, "mysql_execute_command")) { DBUG_RETURN(1); } - + #if MYSQL_VERSION_ID < 50600 - if(do_hot_patch((void **)&trampoline_log_slow_statement, &trampoline_log_slow_statement_size, - (void *)log_slow_statement, (void *)audit_log_slow_statement, "log_slow_statement")) + if (do_hot_patch((void **)&trampoline_log_slow_statement, &trampoline_log_slow_statement_size, + (void *)log_slow_statement, (void *)audit_log_slow_statement, "log_slow_statement")) { sql_print_error("%s Failed hot patch. Continuing as non-critical.", - log_prefix); - + log_prefix); + } #endif - - -#if MYSQL_VERSION_ID < 50505 - if(do_hot_patch((void **)&trampoline_check_user, &trampoline_check_user_size, - (void *)check_user, (void *)audit_check_user, "check_user")) + +#if MYSQL_VERSION_ID < 50505 + if (do_hot_patch((void **)&trampoline_check_user, &trampoline_check_user_size, + (void *)check_user, (void *)audit_check_user, "check_user")) { DBUG_RETURN(1); - } + } #elif MYSQL_VERSION_ID < 50600 - if(do_hot_patch((void **)&trampoline_acl_authenticate, &trampoline_acl_authenticate_size, - (void *)acl_authenticate, (void *)audit_acl_authenticate, "acl_authenticate")) + if (do_hot_patch((void **)&trampoline_acl_authenticate, &trampoline_acl_authenticate_size, + (void *)acl_authenticate, (void *)audit_acl_authenticate, "acl_authenticate")) { DBUG_RETURN(1); } #endif #if defined(MARIADB_BASE_VERSION) || MYSQL_VERSION_ID < 50709 - int (Query_cache::*pf_send_result_to_client)(THD *,char *, uint) = &Query_cache::send_result_to_client; + int (Query_cache::*pf_send_result_to_client)(THD *,char *, uint) = &Query_cache::send_result_to_client; #else int (Query_cache::*pf_send_result_to_client)(THD *,const LEX_CSTRING&) = &Query_cache::send_result_to_client; #endif target_function = *(void **) &pf_send_result_to_client; - if(do_hot_patch((void **)&trampoline_send_result_to_client, &trampoline_send_result_to_client_size, - (void *)target_function, (void *)audit_send_result_to_client, "send_result_to_client")) + if (do_hot_patch((void **)&trampoline_send_result_to_client, &trampoline_send_result_to_client_size, + (void *)target_function, (void *)audit_send_result_to_client, "send_result_to_client")) { DBUG_RETURN(1); } - - if(do_hot_patch((void **)&trampoline_check_table_access, &trampoline_check_table_access_size, - (void *)check_table_access, (void *)audit_check_table_access, "check_table_access")) + + if (do_hot_patch((void **)&trampoline_check_table_access, &trampoline_check_table_access_size, + (void *)check_table_access, (void *)audit_check_table_access, "check_table_access")) { DBUG_RETURN(1); } - + #if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100108 - target_function = (void *)*(bool (*)(THD *thd, const DDL_options_st &options, TABLE_LIST **start, uint *counter, uint flags, - Prelocking_strategy *prelocking_strategy)) &open_tables; -#elif MYSQL_VERSION_ID > 50505 + target_function = (void *)*(bool (*)(THD *thd, const DDL_options_st &options, TABLE_LIST **start, uint *counter, uint flags, + Prelocking_strategy *prelocking_strategy)) &open_tables; +#elif MYSQL_VERSION_ID > 50505 target_function = (void *)*(bool (*)(THD *thd, TABLE_LIST **start, uint *counter, uint flags, - Prelocking_strategy *prelocking_strategy)) &open_tables; + Prelocking_strategy *prelocking_strategy)) &open_tables; #else - target_function = (void *)*(int (*)(THD *thd, TABLE_LIST **start, uint *counter, uint flags)) &open_tables; + target_function = (void *)*(int (*)(THD *thd, TABLE_LIST **start, uint *counter, uint flags)) &open_tables; #endif - if(do_hot_patch((void **)&trampoline_open_tables, &trampoline_open_tables_size, - (void *)target_function, (void *)audit_open_tables, "open_tables")) + if (do_hot_patch((void **)&trampoline_open_tables, &trampoline_open_tables_size, + (void *)target_function, (void *)audit_open_tables, "open_tables")) + { + DBUG_RETURN(1); + } + + if (set_com_status_vars_array () != 0) { DBUG_RETURN(1); } - if (set_com_status_vars_array () !=0) - { - DBUG_RETURN(1); - } sql_print_information("%s Init completed successfully.", log_prefix); - DBUG_RETURN(0); + DBUG_RETURN(0); } /* - plugin deinstallation. - - SYNOPSIS - audit_plugin_deinit() - Does nothing. - - RETURN VALUE - 0 success - 1 failure (cannot happen) - + * plugin deinstallation. + * + * SYNOPSIS + * audit_plugin_deinit() + * Does nothing. + * + * RETURN VALUE + * 0 success + * 1 failure (cannot happen) */ static int audit_plugin_deinit(void *p) -{ - DBUG_ENTER("audit_plugin_deinit"); +{ + DBUG_ENTER("audit_plugin_deinit"); sql_print_information("%s deinit", log_prefix); - remove_hot_functions(); - DBUG_RETURN(0); + remove_hot_functions(); + DBUG_RETURN(0); } /* @@ -1681,48 +1759,44 @@ static struct st_mysql_show_var audit_status[] = , SHOW_SCOPE_GLOBAL #endif }, -//{"called", (char *)&number_of_calls, SHOW_LONG}, +// {"called", (char *)&number_of_calls, SHOW_LONG}, { 0, 0, (enum_mysql_show_type) 0 } }; static void json_log_file_enable(THD *thd, struct st_mysql_sys_var *var, - void *tgt, const void *save) + void *tgt, const void *save) { - json_file_handler_enable = *(my_bool *) save ? TRUE : FALSE; - if(json_file_handler.is_init()) - { - json_file_handler.set_enable(json_file_handler_enable); - } + json_file_handler_enable = *(my_bool *) save ? TRUE : FALSE; + if (json_file_handler.is_init()) + { + json_file_handler.set_enable(json_file_handler_enable); + } } static void json_log_file_flush(THD *thd, struct st_mysql_sys_var *var, - void *tgt, const void *save) + void *tgt, const void *save) { - //always set to false. as we just flush if set to true and leave at 0 - json_file_handler_flush = FALSE; + // always set to false. as we just flush if set to true and leave at 0 + json_file_handler_flush = FALSE; my_bool val = *(my_bool *) save ? TRUE : FALSE; - if(val && json_file_handler.is_init()) - { - json_file_handler.flush(); - } + if (val && json_file_handler.is_init()) + { + json_file_handler.flush(); + } } - - - static void json_log_socket_enable(THD *thd, struct st_mysql_sys_var *var, - void *tgt, const void *save) + void *tgt, const void *save) { - json_socket_handler_enable = *(my_bool *) save ? TRUE : FALSE; - if(json_socket_handler.is_init()) - { - json_socket_handler.set_enable(json_socket_handler_enable); - } + json_socket_handler_enable = *(my_bool *) save ? TRUE : FALSE; + if (json_socket_handler.is_init()) + { + json_socket_handler.set_enable(json_socket_handler_enable); + } } - -//setup sysvars which update directly the relevant plugins +// setup sysvars which update directly the relevant plugins static MYSQL_SYSVAR_BOOL(header_msg, json_formatter.m_write_start_msg, PLUGIN_VAR_RQCMDARG, @@ -1759,7 +1833,7 @@ static MYSQL_SYSVAR_UINT(json_socket_retry, json_socket_handler.m_retry_interval static MYSQL_SYSVAR_BOOL(json_file, json_file_handler_enable, PLUGIN_VAR_RQCMDARG, "AUDIT plugin json log file Enable|Disable", NULL, json_log_file_enable, 0); - + static MYSQL_SYSVAR_BOOL(json_file_flush, json_file_handler_flush, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_NOCMDOPT, "AUDIT plugin json log file flush. Set to ON to perform a flush of the log.", NULL, json_log_file_flush, 0); @@ -1783,10 +1857,10 @@ static MYSQL_SYSVAR_STR(checksum, checksum_string, static MYSQL_SYSVAR_STR(password_masking_regex, password_masking_regex_string, PLUGIN_VAR_RQCMDARG , "AUDIT plugin regex to use for password masking", - password_masking_regex_check, password_masking_regex_string_update, + password_masking_regex_check, password_masking_regex_string_update, default_pw_masking_regex - ); - + ); + static MYSQL_SYSVAR_BOOL(uninstall_plugin, uninstall_plugin_enable, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY , "AUDIT uninstall plugin Enable|Disable. Default disabled. If disabled attempts to uninstall the AUDIT plugin via the sql UNINSTALL command will fail.", NULL, NULL, 0); @@ -1830,8 +1904,8 @@ static MYSQL_SYSVAR_STR(password_masking_cmds, password_masking_cmds_string, PLUGIN_VAR_RQCMDARG, "AUDIT plugin commands to apply password masking regex to, comma separated", NULL, password_masking_cmds_string_update, - //set passowrd is recoreded as set_option - "CREATE_USER,GRANT,SET_OPTION,SLAVE_START,CREATE_SERVER,ALTER_SERVER,CHANGE_MASTER"); + // set passowrd is recoreded as set_option + "CREATE_USER,GRANT,SET_OPTION,SLAVE_START,CREATE_SERVER,ALTER_SERVER,CHANGE_MASTER"); static MYSQL_SYSVAR_STR(whitelist_users, whitelist_users_string, PLUGIN_VAR_RQCMDARG, "AUDIT plugin whitelisted users whose queries are not recorded, comma separated", @@ -1850,7 +1924,7 @@ static struct st_mysql_sys_var* audit_system_variables[] = MYSQL_SYSVAR(header_msg), MYSQL_SYSVAR(force_record_logins), MYSQL_SYSVAR(json_log_file), - MYSQL_SYSVAR(json_file_bufsize), + MYSQL_SYSVAR(json_file_bufsize), MYSQL_SYSVAR(json_file_sync), MYSQL_SYSVAR(json_file_retry), MYSQL_SYSVAR(json_socket_retry), @@ -1867,32 +1941,32 @@ static struct st_mysql_sys_var* audit_system_variables[] = MYSQL_SYSVAR(is_thd_printed_list), MYSQL_SYSVAR(delay_ms), MYSQL_SYSVAR(delay_cmds), - MYSQL_SYSVAR(whitelist_cmds), - MYSQL_SYSVAR(record_cmds), + MYSQL_SYSVAR(whitelist_cmds), + MYSQL_SYSVAR(record_cmds), MYSQL_SYSVAR(password_masking_cmds), - MYSQL_SYSVAR(whitelist_users), - MYSQL_SYSVAR(record_objs), - MYSQL_SYSVAR(checksum), + MYSQL_SYSVAR(whitelist_users), + MYSQL_SYSVAR(record_objs), + MYSQL_SYSVAR(checksum), MYSQL_SYSVAR(password_masking_regex), - - NULL + + NULL }; -//declare our plugin +// declare our plugin mysql_declare_plugin(audit_plugin) { - plugin_type, - &audit_plugin, - "AUDIT", - "McAfee Inc", - "AUDIT plugin, creates a file mysql-audit.log to log activity", - PLUGIN_LICENSE_GPL, - audit_plugin_init, /* Plugin Init */ - audit_plugin_deinit, /* Plugin Deinit */ - 0x0100 /* 1.0 */, - audit_status, /* status variables */ - audit_system_variables, /* system variables */ - NULL /* config options */ + plugin_type, + &audit_plugin, + "AUDIT", + "McAfee Inc", + "AUDIT plugin, creates a file mysql-audit.log to log activity", + PLUGIN_LICENSE_GPL, + audit_plugin_init, /* Plugin Init */ + audit_plugin_deinit, /* Plugin Deinit */ + 0x0100 /* 1.0 */, + audit_status, /* status variables */ + audit_system_variables, /* system variables */ + NULL /* config options */ } mysql_declare_plugin_end; @@ -1904,30 +1978,28 @@ mysql_declare_plugin_end; */ extern "C" void __attribute__ ((constructor)) audit_plugin_so_init(void) { - if (mysqld_builtins && mysqld_builtins[0]) - { - audit_plugin.interface_version = *(int *) mysqld_builtins[0]->info; - sql_print_information("%s Set interface version to: %d (%d)", - log_prefix, audit_plugin.interface_version, - audit_plugin.interface_version >> 8); - } - else - { - sql_print_error( - "%s mysqld_builtins are null. Plugin will not load unless the mysql version is: %d. \n", - log_prefix, audit_plugin.interface_version >> 8); - } + if (mysqld_builtins && mysqld_builtins[0]) + { + audit_plugin.interface_version = *(int *) mysqld_builtins[0]->info; + sql_print_information("%s Set interface version to: %d (%d)", + log_prefix, audit_plugin.interface_version, + audit_plugin.interface_version >> 8); + } + else + { + sql_print_error( + "%s mysqld_builtins are null. Plugin will not load unless the mysql version is: %d. \n", + log_prefix, audit_plugin.interface_version >> 8); + } } #elif MYSQL_VERSION_ID < 50600 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, - audit_plugin.interface_version >> 8); + sql_print_information("%s Set interface version to: %d (%d)", + log_prefix, audit_plugin.interface_version, + audit_plugin.interface_version >> 8); } #elif !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID < 50709 @@ -1935,8 +2007,8 @@ extern "C" void __attribute__ ((constructor)) audit_plugin_so_init(void) // This is not needed for 5.7. extern "C" void __attribute__ ((constructor)) audit_plugin_so_init(void) { - const char * ver_5_6_13 = "5.6.13"; - if(strncmp(server_version, ver_5_6_13, strlen(ver_5_6_13)) <= 0) + const char *ver_5_6_13 = "5.6.13"; + if (strncmp(server_version, ver_5_6_13, strlen(ver_5_6_13)) <= 0) { audit_plugin.interface_version = 0x0300; } @@ -1948,15 +2020,15 @@ extern "C" void __attribute__ ((constructor)) audit_plugin_so_init(void) #endif /* - Pure virtual handler. Needed when running in mysql compiled with a newer version of gcc. - Versions of mysql for RH 6 and Percona this function is defined local in mysqld. - So we define our own implementation. -*/ + * Pure virtual handler. Needed when running in mysql compiled with a newer version of gcc. + * Versions of mysql for RH 6 and Percona this function is defined local in mysqld. + * So we define our own implementation. + */ extern "C" int __cxa_pure_virtual (void) { sql_print_error( - "%s __cxa_pure_virtual called. Fatal condition. ", - log_prefix); + "%s __cxa_pure_virtual called. Fatal condition. ", + log_prefix); return 0; } @@ -1964,8 +2036,3 @@ extern "C" int __cxa_pure_virtual (void) * Variable to hold version */ MYSQL_AUDIT_PLUGIN_SYMBOL_VERSION() = '\0'; - - - - - diff --git a/src/hot_patch.cc b/src/hot_patch.cc index 6a87065..8524f41 100644 --- a/src/hot_patch.cc +++ b/src/hot_patch.cc @@ -11,33 +11,33 @@ #define ULONG_PTR uint32_t #endif -static const char * log_prefix = "Audit Plugin:"; +static const char *log_prefix = "Audit Plugin:"; static const unsigned long PAGE_SIZE = GETPAGESIZE() ; -//used to indicate how to do the protect/unprotect +// used to indicate how to do the protect/unprotect static bool use_exec_prot = true; static int protect(void *addr, size_t len) { int res = 0; - if(use_exec_prot) + if (use_exec_prot) { res = mprotect(addr,len,PROT_READ|PROT_EXEC); } - else //try doing in a 2 step fashion + else // try doing in a 2 step fashion { mprotect(addr,len,PROT_READ); - res = mprotect(addr,len,PROT_READ|PROT_EXEC); + res = mprotect(addr,len,PROT_READ|PROT_EXEC); } - if(res) + if (res) { sql_print_information( "%s unable to protect mode: PROT_READ|PROT_EXEC. Page: %p, Size: %zu, errno: %d, res %d.", log_prefix, (void *)addr, len, errno, res); - //fail only if nx bit is enabled - FILE * fp = fopen("/proc/cpuinfo", "r"); - if(NULL == fp) + // fail only if nx bit is enabled + FILE *fp = fopen("/proc/cpuinfo", "r"); + if (NULL == fp) { sql_print_error( "%s unable to verify nx bit. Failed checking /proc/cpuinfo. This may happen if you have SELinux enabled. Disable SELinux execmod protection for mysqld. Page: %p, Size: %zu, errno: %d.", @@ -45,21 +45,21 @@ static int protect(void *addr, size_t len) return res; } char buff[1024] = {0}; - const char * flags = "flags"; - bool nxchecked = false; - while(fgets(buff, 1024, fp) != NULL) + const char *flags = "flags"; + bool nxchecked = false; + while (fgets(buff, 1024, fp) != NULL) { - char * line = buff; - //trim white space at start + char *line = buff; + // trim white space at start while ((strlen(line) > 0) && (isspace(line[0]))) { line++; } - if(strncmp(line, flags, strlen(flags)) == 0) + if (strncmp(line, flags, strlen(flags)) == 0) { nxchecked = true; sql_print_information("%s cpuinfo flags line: %s. ",log_prefix, line); - if(strstr(line, " nx")) //nx enabled so fail + if (strstr(line, " nx")) // nx enabled so fail { sql_print_error( "%s unable to protect page and nx bit enabled. This may happen if you have SELinux enabled. Disable SELinux execmod protection for mysqld. Page: %p, Size: %zu.", @@ -71,7 +71,7 @@ static int protect(void *addr, size_t len) } } fclose(fp); - if(!nxchecked) //we didn't find flags string for some reason + if (! nxchecked) // we didn't find flags string for some reason { sql_print_error( "%s unable to verify nx bit. Failed finding: %s in /proc/cpuinfo. This may happen if you have SELinux enabled. Disable SELinux execmod protection for mysqld. Page: %p, Size: %zu.", @@ -82,66 +82,67 @@ static int protect(void *addr, size_t len) return 0; } -//will try to unprotect with PROT_READ|PROT_WRITE|PROT_EXEC. If fails (might happen under SELinux) -//will use PROT_READ|PROT_WRITE +// will try to unprotect with PROT_READ|PROT_WRITE|PROT_EXEC. If fails (might happen under SELinux) +// will use PROT_READ|PROT_WRITE static int unprotect(void *addr, size_t len) -{ +{ int res; - if(use_exec_prot) + if (use_exec_prot) { - res = mprotect(addr,len,PROT_READ|PROT_WRITE|PROT_EXEC); - if(res) + res = mprotect(addr, len, PROT_READ|PROT_WRITE|PROT_EXEC); + if (res) { sql_print_information( - "%s unable to unprotect. Page: %p, Size: %zu, errno: %d. Using NO EXEC mode.", - log_prefix, (void *)addr, len, errno); + "%s unable to unprotect. Page: %p, Size: %zu, errno: %d. Using NO EXEC mode.", + log_prefix, (void *)addr, len, errno); use_exec_prot = false; - //do a sanity test that we can actually unprotect/protect and that nx bit is off + // do a sanity test that we can actually unprotect/protect and that nx bit is off res = unprotect(addr, len); - if(res) + if (res) { - sql_print_error( - "%s unable to unprotect page. This may happen if you have SELinux enabled. Disable SELinux execmod protection for mysqld. Aborting. Page: %p, Size: %zu, errno: %d.", - log_prefix, (void *)addr, len, errno); - return res; + sql_print_error( + "%s unable to unprotect page. This may happen if you have SELinux enabled. Disable SELinux execmod protection for mysqld. Aborting. Page: %p, Size: %zu, errno: %d.", + log_prefix, (void *)addr, len, errno); + return res; } res = protect(addr, len); sql_print_information("%s protect res: %d", log_prefix, res); - if(res) - { + if (res) + { sql_print_error( - "%s unable to protect page. This may happen if you have SELinux enabled. Disable SELinux execmod protection for mysqld. Aborting. Page: %p, Size: %zu, errno: %d.", - log_prefix, (void *)addr, len, errno); - return res; - } + "%s unable to protect page. This may happen if you have SELinux enabled. Disable SELinux execmod protection for mysqld. Aborting. Page: %p, Size: %zu, errno: %d.", + log_prefix, (void *)addr, len, errno); + return res; + } } - else //all is good + else // all is good { return res; } } - res = mprotect(addr,len,PROT_READ|PROT_WRITE); - if(0 != res) //log the failure + + res = mprotect(addr, len, PROT_READ|PROT_WRITE); + if (0 != res) // log the failure { sql_print_error( - "%s unable to unprotect. Page: %p, Size: %zu, errno: %d. Error.", - log_prefix, (void *)addr, len, errno); + "%s unable to unprotect. Page: %p, Size: %zu, errno: %d. Error.", + log_prefix, (void *)addr, len, errno); } - return res; + return res; } -//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) +// 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) +static DATATYPE_ADDRESS get_page_address(void *pointer) { DATATYPE_ADDRESS pageMask = ( ~(PAGE_SIZE - 1) ) ; DATATYPE_ADDRESS longp = (unsigned long) pointer; - return (longp & pageMask); + return (longp & pageMask); } // @@ -164,112 +165,115 @@ unsigned int jump_size() static void WriteJump(void *pAddress, ULONG_PTR JumpTo) { - DATATYPE_ADDRESS AddressPage = get_page_address(pAddress); - unprotect((void*)AddressPage, PAGE_SIZE); + DATATYPE_ADDRESS AddressPage = get_page_address(pAddress); + unprotect((void*)AddressPage, PAGE_SIZE); - BYTE *pCur = (BYTE *) pAddress; + BYTE *pCur = (BYTE *) pAddress; #ifndef __x86_64__ BYTE * pbJmpSrc = pCur + 5; - *pCur++ = 0xE9; // jmp +imm32 - *((ULONG_PTR *)pCur) = JumpTo - (ULONG_PTR)pbJmpSrc; + *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; + *pCur = 0xff; // jmp [rip+addr] + *(++pCur) = 0x25; + *((DWORD *) ++pCur) = 0; // addr = 0 + pCur += sizeof (DWORD); + *((ULONG_PTR *)pCur) = JumpTo; #endif - //} + // DWORD dwBuf = 0; // necessary othewrise the function fails - //DWORD dwBuf = 0; // nessary othewrise the function fails - - protect((void*)AddressPage, PAGE_SIZE); + protect((void*)AddressPage, PAGE_SIZE); } // // Hooks a function // -static bool HookFunction(ULONG_PTR targetFunction, ULONG_PTR newFunction, ULONG_PTR trampolineFunction, +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; +#define MAX_INSTRUCTIONS 100 + uint8_t raw[MAX_INSTRUCTIONS]; + unsigned int uCurrentSize =0; #ifndef __x86_64__ - #define ASM_MODE 32 +#define ASM_MODE 32 #else - #define ASM_MODE 64 +#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); - ud_set_pc(&ud_obj, targetFunction); + 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); + ud_set_pc(&ud_obj, targetFunction); - DWORD InstrSize = 0; - DATATYPE_ADDRESS trampolineFunctionPage = get_page_address((void*)trampolineFunction); - if(unprotect((void*)trampolineFunctionPage, PAGE_SIZE) != 0) + DWORD InstrSize = 0; + DATATYPE_ADDRESS trampolineFunctionPage = get_page_address((void*)trampolineFunction); + if (unprotect((void*)trampolineFunctionPage, PAGE_SIZE) != 0) { sql_print_error( - "%s unable to unprotect trampoline function page: %p. Aborting.", - log_prefix, (void *)trampolineFunctionPage); + "%s unable to unprotect trampoline function page: %p. Aborting.", + log_prefix, (void *)trampolineFunctionPage); return false; } - bool disassemble_valid = false; - while (ud_disassemble(&ud_obj)) - { - if(ud_obj.mnemonic == UD_Iinvalid) - { - sql_print_error( - "%s unable to disassemble at address: %p. Aborting.", - log_prefix, (void *)(InstrSize + targetFunction)); - break; - } - //make sure there isn't a jmp/call (or similar operand) as these use - //relative addressing and if we copy as is we will mess up the jmp/call target - if(ud_obj.mnemonic == UD_Ijmp || ud_obj.mnemonic == UD_Icall || - ud_obj.operand[0].type == UD_OP_JIMM) - { - sql_print_error( - "%s unable to disassemble at address: 0x%p. Found relative addressing for instruction: [%s]. Aborting.", - log_prefix, (void *)(InstrSize + targetFunction), ud_insn_asm(&ud_obj)); - break; - } - BYTE *pCurInstr = (BYTE *) (InstrSize + (ULONG_PTR) targetFunction); - memcpy((BYTE*)trampolineFunction + uCurrentSize, - (void *) pCurInstr, ud_insn_len (&ud_obj)); + bool disassemble_valid = false; + while (ud_disassemble(&ud_obj)) + { + if (ud_obj.mnemonic == UD_Iinvalid) + { + sql_print_error( + "%s unable to disassemble at address: %p. Aborting.", + log_prefix, (void *)(InstrSize + targetFunction)); + break; + } - uCurrentSize += ud_insn_len (&ud_obj); - InstrSize += ud_insn_len (&ud_obj); - if (InstrSize >= jump_size()) //we have enough space so break - { - disassemble_valid = true; - break; - } - } - if(protect((void*)trampolineFunctionPage, PAGE_SIZE)) //0 valid return + // make sure there isn't a jmp/call (or similar operand) as these use + // relative addressing and if we copy as is we will mess up the jmp/call target + if (ud_obj.mnemonic == UD_Ijmp || ud_obj.mnemonic == UD_Icall || + ud_obj.operand[0].type == UD_OP_JIMM) + { + sql_print_error( + "%s unable to disassemble at address: 0x%p. Found relative addressing for instruction: [%s]. Aborting.", + log_prefix, (void *)(InstrSize + targetFunction), ud_insn_asm(&ud_obj)); + 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); + if (InstrSize >= jump_size()) // we have enough space so break + { + disassemble_valid = true; + break; + } + } + + if (protect((void*)trampolineFunctionPage, PAGE_SIZE)) // 0 valid return { sql_print_error( - "%s unable to protect page. Error. Page: %p.", - log_prefix, (void *)trampolineFunctionPage); + "%s unable to protect page. Error. Page: %p.", + log_prefix, (void *)trampolineFunctionPage); return false; } - if(!disassemble_valid) //something went wrong. log was written before so return false - { - return false; - } - WriteJump( (BYTE*)trampolineFunction + uCurrentSize, targetFunction + InstrSize); - WriteJump((void *) targetFunction, newFunction); - *trampolinesize = uCurrentSize; - return true; + + if (! disassemble_valid) // something went wrong. log was written before so return false + { + return false; + } + + WriteJump((BYTE*)trampolineFunction + uCurrentSize, targetFunction + InstrSize); + WriteJump((void *) targetFunction, newFunction); + *trampolinesize = uCurrentSize; + return true; } // @@ -277,18 +281,18 @@ static bool HookFunction(ULONG_PTR targetFunction, ULONG_PTR newFunction, ULONG // -static void UnhookFunction(ULONG_PTR Function,ULONG_PTR trampolineFunction , unsigned int trampolinesize) +static void UnhookFunction(ULONG_PTR Function, ULONG_PTR trampolineFunction, unsigned int trampolinesize) { - DATATYPE_ADDRESS FunctionPage = get_page_address((void*)Function); - if(unprotect((void*)FunctionPage, PAGE_SIZE) != 0) + DATATYPE_ADDRESS FunctionPage = get_page_address((void*)Function); + if (unprotect((void*)FunctionPage, PAGE_SIZE) != 0) { sql_print_error( - "%s Unhook not able to unprotect function page: %p. Aborting.", - log_prefix, (void * )FunctionPage); + "%s Unhook not able to unprotect function page: %p. Aborting.", + log_prefix, (void * )FunctionPage); return; } - memcpy((void *) Function, (void*)trampolineFunction,trampolinesize); - protect((void*)FunctionPage, PAGE_SIZE); + memcpy((void *) Function, (void*)trampolineFunction,trampolinesize); + protect((void*)FunctionPage, PAGE_SIZE); } /** @@ -303,24 +307,24 @@ static void UnhookFunction(ULONG_PTR Function,ULONG_PTR trampolineFunction , uns * @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. + * which contains a bunch of nops. * @param info_print if true will print info as progressing * @Return 0 on success otherwise failure - * @See MS Detours paper: http://research.microsoft.com/pubs/68568/huntusenixnt99.pdf for some background info. + * @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) +int hot_patch_function(void *targetFunction, void *newFunction, void *trampolineFunction, unsigned int *trampolinesize, bool info_print) { DATATYPE_ADDRESS trampolinePage = get_page_address(trampolineFunction); cond_info_print(info_print, "%s hot patching function: %p, trampolineFunction: %p trampolinePage: %p",log_prefix, (void *)targetFunction, (void *)trampolineFunction, (void *)trampolinePage); - if (HookFunction((ULONG_PTR) targetFunction, (ULONG_PTR) newFunction, - (ULONG_PTR) trampolineFunction, trampolinesize)) - { - return 0; - } - else - { - return -1; - } + if (HookFunction((ULONG_PTR) targetFunction, (ULONG_PTR) newFunction, + (ULONG_PTR) trampolineFunction, trampolinesize)) + { + return 0; + } + else + { + return -1; + } } @@ -332,15 +336,15 @@ int hot_patch_function (void* targetFunction, void* newFunction, void * trampoli * @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) +void remove_hot_patch_function(void *targetFunction, void *trampolineFunction, unsigned int trampolinesize, bool info_print) { - if(trampolinesize == 0) + if (trampolinesize == 0) { - //nothing todo. As hot patch was not set. + // nothing todo. As hot patch was not set. return; } DATATYPE_ADDRESS targetPage = get_page_address(targetFunction); cond_info_print(info_print, "%s removing hot patching function: %p targetPage: %p trampolineFunction: %p",log_prefix, (void *)targetFunction, (void *)targetPage, (void *)trampolineFunction); UnhookFunction ((ULONG_PTR) targetFunction, (ULONG_PTR)trampolineFunction,trampolinesize); - return; + return; } diff --git a/src/md5.cc b/src/md5.cc old mode 100755 new mode 100644 index 57ec146..2b92869 --- a/src/md5.cc +++ b/src/md5.cc @@ -1,297 +1,297 @@ -/* - * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc. - * MD5 Message-Digest Algorithm (RFC 1321). - * - * Homepage: - * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 - * - * Author: - * Alexander Peslyak, better known as Solar Designer - * - * This software was written by Alexander Peslyak in 2001. No copyright is - * claimed, and the software is hereby placed in the public domain. - * In case this attempt to disclaim copyright and place the software in the - * public domain is deemed null and void, then the software is - * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the - * general public under the following terms: - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted. - * - * There's ABSOLUTELY NO WARRANTY, express or implied. - * - * (This is a heavily cut-down "BSD license".) - * - * This differs from Colin Plumb's older public domain implementation in that - * no exactly 32-bit integer data type is required (any 32-bit or wider - * unsigned integer data type will do), there's no compile-time endianness - * configuration, and the function prototypes match OpenSSL's. No code from - * Colin Plumb's implementation has been reused; this comment merely compares - * the properties of the two independent implementations. - * - * The primary goals of this implementation are portability and ease of use. - * It is meant to be fast, but not as fast as possible. Some known - * optimizations are not included to reduce source code size and avoid - * compile-time configuration. - * - * Modified: to have naming convention as used in MySQL 5.1 and 5.5 - */ - -#include - -#include "md5.h" - -#if MYSQL_VERSION_ID >= 50600 - -/* - * The basic MD5 functions. - * - * F and G are optimized compared to their RFC 1321 definitions for - * architectures that lack an AND-NOT instruction, just like in Colin Plumb's - * implementation. - */ -#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) -#define G(x, y, z) ((y) ^ ((z) & ((x) ^ (y)))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) -#define I(x, y, z) ((y) ^ ((x) | ~(z))) - -/* - * The MD5 transformation for all four rounds. - */ -#define STEP(f, a, b, c, d, x, t, s) \ - (a) += f((b), (c), (d)) + (x) + (t); \ - (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); \ - (a) += (b); - -/* - * SET reads 4 input bytes in little-endian byte order and stores them - * in a properly aligned word in host byte order. - * - * The check for little-endian architectures that tolerate unaligned - * memory accesses is just an optimization. Nothing will break if it - * doesn't work. - */ -#if defined(__i386__) || defined(__x86_64__) || defined(__vax__) -#define SET(n) \ - (*(MD5_u32plus *)&ptr[(n) * 4]) -#define GET(n) \ - SET(n) -#else -#define SET(n) \ - (ctx->block[(n)] = \ - (MD5_u32plus)ptr[(n) * 4] | \ - ((MD5_u32plus)ptr[(n) * 4 + 1] << 8) | \ - ((MD5_u32plus)ptr[(n) * 4 + 2] << 16) | \ - ((MD5_u32plus)ptr[(n) * 4 + 3] << 24)) -#define GET(n) \ - (ctx->block[(n)]) -#endif - -/* - * This processes one or more 64-byte data blocks, but does NOT update - * the bit counters. There are no alignment requirements. - */ -static void *body(MD5_CTX *ctx, void *data, unsigned long size) -{ - unsigned char *ptr; - MD5_u32plus a, b, c, d; - MD5_u32plus saved_a, saved_b, saved_c, saved_d; - - ptr = (unsigned char *)data; - - a = ctx->a; - b = ctx->b; - c = ctx->c; - d = ctx->d; - - do { - saved_a = a; - saved_b = b; - saved_c = c; - saved_d = d; - -/* Round 1 */ - STEP(F, a, b, c, d, SET(0), 0xd76aa478, 7) - STEP(F, d, a, b, c, SET(1), 0xe8c7b756, 12) - STEP(F, c, d, a, b, SET(2), 0x242070db, 17) - STEP(F, b, c, d, a, SET(3), 0xc1bdceee, 22) - STEP(F, a, b, c, d, SET(4), 0xf57c0faf, 7) - STEP(F, d, a, b, c, SET(5), 0x4787c62a, 12) - STEP(F, c, d, a, b, SET(6), 0xa8304613, 17) - STEP(F, b, c, d, a, SET(7), 0xfd469501, 22) - STEP(F, a, b, c, d, SET(8), 0x698098d8, 7) - STEP(F, d, a, b, c, SET(9), 0x8b44f7af, 12) - STEP(F, c, d, a, b, SET(10), 0xffff5bb1, 17) - STEP(F, b, c, d, a, SET(11), 0x895cd7be, 22) - STEP(F, a, b, c, d, SET(12), 0x6b901122, 7) - STEP(F, d, a, b, c, SET(13), 0xfd987193, 12) - STEP(F, c, d, a, b, SET(14), 0xa679438e, 17) - STEP(F, b, c, d, a, SET(15), 0x49b40821, 22) - -/* Round 2 */ - STEP(G, a, b, c, d, GET(1), 0xf61e2562, 5) - STEP(G, d, a, b, c, GET(6), 0xc040b340, 9) - STEP(G, c, d, a, b, GET(11), 0x265e5a51, 14) - STEP(G, b, c, d, a, GET(0), 0xe9b6c7aa, 20) - STEP(G, a, b, c, d, GET(5), 0xd62f105d, 5) - STEP(G, d, a, b, c, GET(10), 0x02441453, 9) - STEP(G, c, d, a, b, GET(15), 0xd8a1e681, 14) - STEP(G, b, c, d, a, GET(4), 0xe7d3fbc8, 20) - STEP(G, a, b, c, d, GET(9), 0x21e1cde6, 5) - STEP(G, d, a, b, c, GET(14), 0xc33707d6, 9) - STEP(G, c, d, a, b, GET(3), 0xf4d50d87, 14) - STEP(G, b, c, d, a, GET(8), 0x455a14ed, 20) - STEP(G, a, b, c, d, GET(13), 0xa9e3e905, 5) - STEP(G, d, a, b, c, GET(2), 0xfcefa3f8, 9) - STEP(G, c, d, a, b, GET(7), 0x676f02d9, 14) - STEP(G, b, c, d, a, GET(12), 0x8d2a4c8a, 20) - -/* Round 3 */ - STEP(H, a, b, c, d, GET(5), 0xfffa3942, 4) - STEP(H, d, a, b, c, GET(8), 0x8771f681, 11) - STEP(H, c, d, a, b, GET(11), 0x6d9d6122, 16) - STEP(H, b, c, d, a, GET(14), 0xfde5380c, 23) - STEP(H, a, b, c, d, GET(1), 0xa4beea44, 4) - STEP(H, d, a, b, c, GET(4), 0x4bdecfa9, 11) - STEP(H, c, d, a, b, GET(7), 0xf6bb4b60, 16) - STEP(H, b, c, d, a, GET(10), 0xbebfbc70, 23) - STEP(H, a, b, c, d, GET(13), 0x289b7ec6, 4) - STEP(H, d, a, b, c, GET(0), 0xeaa127fa, 11) - STEP(H, c, d, a, b, GET(3), 0xd4ef3085, 16) - STEP(H, b, c, d, a, GET(6), 0x04881d05, 23) - STEP(H, a, b, c, d, GET(9), 0xd9d4d039, 4) - STEP(H, d, a, b, c, GET(12), 0xe6db99e5, 11) - STEP(H, c, d, a, b, GET(15), 0x1fa27cf8, 16) - STEP(H, b, c, d, a, GET(2), 0xc4ac5665, 23) - -/* Round 4 */ - STEP(I, a, b, c, d, GET(0), 0xf4292244, 6) - STEP(I, d, a, b, c, GET(7), 0x432aff97, 10) - STEP(I, c, d, a, b, GET(14), 0xab9423a7, 15) - STEP(I, b, c, d, a, GET(5), 0xfc93a039, 21) - STEP(I, a, b, c, d, GET(12), 0x655b59c3, 6) - STEP(I, d, a, b, c, GET(3), 0x8f0ccc92, 10) - STEP(I, c, d, a, b, GET(10), 0xffeff47d, 15) - STEP(I, b, c, d, a, GET(1), 0x85845dd1, 21) - STEP(I, a, b, c, d, GET(8), 0x6fa87e4f, 6) - STEP(I, d, a, b, c, GET(15), 0xfe2ce6e0, 10) - STEP(I, c, d, a, b, GET(6), 0xa3014314, 15) - STEP(I, b, c, d, a, GET(13), 0x4e0811a1, 21) - STEP(I, a, b, c, d, GET(4), 0xf7537e82, 6) - STEP(I, d, a, b, c, GET(11), 0xbd3af235, 10) - STEP(I, c, d, a, b, GET(2), 0x2ad7d2bb, 15) - STEP(I, b, c, d, a, GET(9), 0xeb86d391, 21) - - a += saved_a; - b += saved_b; - c += saved_c; - d += saved_d; - - ptr += 64; - } while (size -= 64); - - ctx->a = a; - ctx->b = b; - ctx->c = c; - ctx->d = d; - - return ptr; -} - -void MD5_Init(MD5_CTX *ctx) -{ - ctx->a = 0x67452301; - ctx->b = 0xefcdab89; - ctx->c = 0x98badcfe; - ctx->d = 0x10325476; - - ctx->lo = 0; - ctx->hi = 0; -} - -void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size) -{ - MD5_u32plus saved_lo; - unsigned long used, free; - - saved_lo = ctx->lo; - if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) - ctx->hi++; - ctx->hi += size >> 29; - - used = saved_lo & 0x3f; - - if (used) { - free = 64 - used; - - if (size < free) { - memcpy(&ctx->buffer[used], data, size); - return; - } - - memcpy(&ctx->buffer[used], data, free); - data = (unsigned char *)data + free; - size -= free; - body(ctx, ctx->buffer, 64); - } - - if (size >= 64) { - data = body(ctx, data, size & ~(unsigned long)0x3f); - size &= 0x3f; - } - - memcpy(ctx->buffer, data, size); -} - -void MD5_Final(unsigned char *result, MD5_CTX *ctx) -{ - unsigned long used, free; - - used = ctx->lo & 0x3f; - - ctx->buffer[used++] = 0x80; - - free = 64 - used; - - if (free < 8) { - memset(&ctx->buffer[used], 0, free); - body(ctx, ctx->buffer, 64); - used = 0; - free = 64; - } - - memset(&ctx->buffer[used], 0, free - 8); - - ctx->lo <<= 3; - ctx->buffer[56] = ctx->lo; - ctx->buffer[57] = ctx->lo >> 8; - ctx->buffer[58] = ctx->lo >> 16; - ctx->buffer[59] = ctx->lo >> 24; - ctx->buffer[60] = ctx->hi; - ctx->buffer[61] = ctx->hi >> 8; - ctx->buffer[62] = ctx->hi >> 16; - ctx->buffer[63] = ctx->hi >> 24; - - body(ctx, ctx->buffer, 64); - - result[0] = ctx->a; - result[1] = ctx->a >> 8; - result[2] = ctx->a >> 16; - result[3] = ctx->a >> 24; - result[4] = ctx->b; - result[5] = ctx->b >> 8; - result[6] = ctx->b >> 16; - result[7] = ctx->b >> 24; - result[8] = ctx->c; - result[9] = ctx->c >> 8; - result[10] = ctx->c >> 16; - result[11] = ctx->c >> 24; - result[12] = ctx->d; - result[13] = ctx->d >> 8; - result[14] = ctx->d >> 16; - result[15] = ctx->d >> 24; - - memset(ctx, 0, sizeof(*ctx)); -} - -#endif +/* + * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc. + * MD5 Message-Digest Algorithm (RFC 1321). + * + * Homepage: + * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 + * + * Author: + * Alexander Peslyak, better known as Solar Designer + * + * This software was written by Alexander Peslyak in 2001. No copyright is + * claimed, and the software is hereby placed in the public domain. + * In case this attempt to disclaim copyright and place the software in the + * public domain is deemed null and void, then the software is + * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the + * general public under the following terms: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted. + * + * There's ABSOLUTELY NO WARRANTY, express or implied. + * + * (This is a heavily cut-down "BSD license".) + * + * This differs from Colin Plumb's older public domain implementation in that + * no exactly 32-bit integer data type is required (any 32-bit or wider + * unsigned integer data type will do), there's no compile-time endianness + * configuration, and the function prototypes match OpenSSL's. No code from + * Colin Plumb's implementation has been reused; this comment merely compares + * the properties of the two independent implementations. + * + * The primary goals of this implementation are portability and ease of use. + * It is meant to be fast, but not as fast as possible. Some known + * optimizations are not included to reduce source code size and avoid + * compile-time configuration. + * + * Modified: to have naming convention as used in MySQL 5.1 and 5.5 + */ + +#include + +#include "md5.h" + +#if MYSQL_VERSION_ID >= 50600 + +/* + * The basic MD5 functions. + * + * F and G are optimized compared to their RFC 1321 definitions for + * architectures that lack an AND-NOT instruction, just like in Colin Plumb's + * implementation. + */ +#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) +#define G(x, y, z) ((y) ^ ((z) & ((x) ^ (y)))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) +#define I(x, y, z) ((y) ^ ((x) | ~(z))) + +/* + * The MD5 transformation for all four rounds. + */ +#define STEP(f, a, b, c, d, x, t, s) \ + (a) += f((b), (c), (d)) + (x) + (t); \ + (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); \ + (a) += (b); + +/* + * SET reads 4 input bytes in little-endian byte order and stores them + * in a properly aligned word in host byte order. + * + * The check for little-endian architectures that tolerate unaligned + * memory accesses is just an optimization. Nothing will break if it + * doesn't work. + */ +#if defined(__i386__) || defined(__x86_64__) || defined(__vax__) +#define SET(n) \ + (*(MD5_u32plus *)&ptr[(n) * 4]) +#define GET(n) \ + SET(n) +#else +#define SET(n) \ + (ctx->block[(n)] = \ + (MD5_u32plus)ptr[(n) * 4] | \ + ((MD5_u32plus)ptr[(n) * 4 + 1] << 8) | \ + ((MD5_u32plus)ptr[(n) * 4 + 2] << 16) | \ + ((MD5_u32plus)ptr[(n) * 4 + 3] << 24)) +#define GET(n) \ + (ctx->block[(n)]) +#endif + +/* + * This processes one or more 64-byte data blocks, but does NOT update + * the bit counters. There are no alignment requirements. + */ +static void *body(MD5_CTX *ctx, void *data, unsigned long size) +{ + unsigned char *ptr; + MD5_u32plus a, b, c, d; + MD5_u32plus saved_a, saved_b, saved_c, saved_d; + + ptr = (unsigned char *)data; + + a = ctx->a; + b = ctx->b; + c = ctx->c; + d = ctx->d; + + do { + saved_a = a; + saved_b = b; + saved_c = c; + saved_d = d; + +/* Round 1 */ + STEP(F, a, b, c, d, SET(0), 0xd76aa478, 7) + STEP(F, d, a, b, c, SET(1), 0xe8c7b756, 12) + STEP(F, c, d, a, b, SET(2), 0x242070db, 17) + STEP(F, b, c, d, a, SET(3), 0xc1bdceee, 22) + STEP(F, a, b, c, d, SET(4), 0xf57c0faf, 7) + STEP(F, d, a, b, c, SET(5), 0x4787c62a, 12) + STEP(F, c, d, a, b, SET(6), 0xa8304613, 17) + STEP(F, b, c, d, a, SET(7), 0xfd469501, 22) + STEP(F, a, b, c, d, SET(8), 0x698098d8, 7) + STEP(F, d, a, b, c, SET(9), 0x8b44f7af, 12) + STEP(F, c, d, a, b, SET(10), 0xffff5bb1, 17) + STEP(F, b, c, d, a, SET(11), 0x895cd7be, 22) + STEP(F, a, b, c, d, SET(12), 0x6b901122, 7) + STEP(F, d, a, b, c, SET(13), 0xfd987193, 12) + STEP(F, c, d, a, b, SET(14), 0xa679438e, 17) + STEP(F, b, c, d, a, SET(15), 0x49b40821, 22) + +/* Round 2 */ + STEP(G, a, b, c, d, GET(1), 0xf61e2562, 5) + STEP(G, d, a, b, c, GET(6), 0xc040b340, 9) + STEP(G, c, d, a, b, GET(11), 0x265e5a51, 14) + STEP(G, b, c, d, a, GET(0), 0xe9b6c7aa, 20) + STEP(G, a, b, c, d, GET(5), 0xd62f105d, 5) + STEP(G, d, a, b, c, GET(10), 0x02441453, 9) + STEP(G, c, d, a, b, GET(15), 0xd8a1e681, 14) + STEP(G, b, c, d, a, GET(4), 0xe7d3fbc8, 20) + STEP(G, a, b, c, d, GET(9), 0x21e1cde6, 5) + STEP(G, d, a, b, c, GET(14), 0xc33707d6, 9) + STEP(G, c, d, a, b, GET(3), 0xf4d50d87, 14) + STEP(G, b, c, d, a, GET(8), 0x455a14ed, 20) + STEP(G, a, b, c, d, GET(13), 0xa9e3e905, 5) + STEP(G, d, a, b, c, GET(2), 0xfcefa3f8, 9) + STEP(G, c, d, a, b, GET(7), 0x676f02d9, 14) + STEP(G, b, c, d, a, GET(12), 0x8d2a4c8a, 20) + +/* Round 3 */ + STEP(H, a, b, c, d, GET(5), 0xfffa3942, 4) + STEP(H, d, a, b, c, GET(8), 0x8771f681, 11) + STEP(H, c, d, a, b, GET(11), 0x6d9d6122, 16) + STEP(H, b, c, d, a, GET(14), 0xfde5380c, 23) + STEP(H, a, b, c, d, GET(1), 0xa4beea44, 4) + STEP(H, d, a, b, c, GET(4), 0x4bdecfa9, 11) + STEP(H, c, d, a, b, GET(7), 0xf6bb4b60, 16) + STEP(H, b, c, d, a, GET(10), 0xbebfbc70, 23) + STEP(H, a, b, c, d, GET(13), 0x289b7ec6, 4) + STEP(H, d, a, b, c, GET(0), 0xeaa127fa, 11) + STEP(H, c, d, a, b, GET(3), 0xd4ef3085, 16) + STEP(H, b, c, d, a, GET(6), 0x04881d05, 23) + STEP(H, a, b, c, d, GET(9), 0xd9d4d039, 4) + STEP(H, d, a, b, c, GET(12), 0xe6db99e5, 11) + STEP(H, c, d, a, b, GET(15), 0x1fa27cf8, 16) + STEP(H, b, c, d, a, GET(2), 0xc4ac5665, 23) + +/* Round 4 */ + STEP(I, a, b, c, d, GET(0), 0xf4292244, 6) + STEP(I, d, a, b, c, GET(7), 0x432aff97, 10) + STEP(I, c, d, a, b, GET(14), 0xab9423a7, 15) + STEP(I, b, c, d, a, GET(5), 0xfc93a039, 21) + STEP(I, a, b, c, d, GET(12), 0x655b59c3, 6) + STEP(I, d, a, b, c, GET(3), 0x8f0ccc92, 10) + STEP(I, c, d, a, b, GET(10), 0xffeff47d, 15) + STEP(I, b, c, d, a, GET(1), 0x85845dd1, 21) + STEP(I, a, b, c, d, GET(8), 0x6fa87e4f, 6) + STEP(I, d, a, b, c, GET(15), 0xfe2ce6e0, 10) + STEP(I, c, d, a, b, GET(6), 0xa3014314, 15) + STEP(I, b, c, d, a, GET(13), 0x4e0811a1, 21) + STEP(I, a, b, c, d, GET(4), 0xf7537e82, 6) + STEP(I, d, a, b, c, GET(11), 0xbd3af235, 10) + STEP(I, c, d, a, b, GET(2), 0x2ad7d2bb, 15) + STEP(I, b, c, d, a, GET(9), 0xeb86d391, 21) + + a += saved_a; + b += saved_b; + c += saved_c; + d += saved_d; + + ptr += 64; + } while (size -= 64); + + ctx->a = a; + ctx->b = b; + ctx->c = c; + ctx->d = d; + + return ptr; +} + +void MD5_Init(MD5_CTX *ctx) +{ + ctx->a = 0x67452301; + ctx->b = 0xefcdab89; + ctx->c = 0x98badcfe; + ctx->d = 0x10325476; + + ctx->lo = 0; + ctx->hi = 0; +} + +void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size) +{ + MD5_u32plus saved_lo; + unsigned long used, free; + + saved_lo = ctx->lo; + if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) + ctx->hi++; + ctx->hi += size >> 29; + + used = saved_lo & 0x3f; + + if (used) { + free = 64 - used; + + if (size < free) { + memcpy(&ctx->buffer[used], data, size); + return; + } + + memcpy(&ctx->buffer[used], data, free); + data = (unsigned char *)data + free; + size -= free; + body(ctx, ctx->buffer, 64); + } + + if (size >= 64) { + data = body(ctx, data, size & ~(unsigned long)0x3f); + size &= 0x3f; + } + + memcpy(ctx->buffer, data, size); +} + +void MD5_Final(unsigned char *result, MD5_CTX *ctx) +{ + unsigned long used, free; + + used = ctx->lo & 0x3f; + + ctx->buffer[used++] = 0x80; + + free = 64 - used; + + if (free < 8) { + memset(&ctx->buffer[used], 0, free); + body(ctx, ctx->buffer, 64); + used = 0; + free = 64; + } + + memset(&ctx->buffer[used], 0, free - 8); + + ctx->lo <<= 3; + ctx->buffer[56] = ctx->lo; + ctx->buffer[57] = ctx->lo >> 8; + ctx->buffer[58] = ctx->lo >> 16; + ctx->buffer[59] = ctx->lo >> 24; + ctx->buffer[60] = ctx->hi; + ctx->buffer[61] = ctx->hi >> 8; + ctx->buffer[62] = ctx->hi >> 16; + ctx->buffer[63] = ctx->hi >> 24; + + body(ctx, ctx->buffer, 64); + + result[0] = ctx->a; + result[1] = ctx->a >> 8; + result[2] = ctx->a >> 16; + result[3] = ctx->a >> 24; + result[4] = ctx->b; + result[5] = ctx->b >> 8; + result[6] = ctx->b >> 16; + result[7] = ctx->b >> 24; + result[8] = ctx->c; + result[9] = ctx->c >> 8; + result[10] = ctx->c >> 16; + result[11] = ctx->c >> 24; + result[12] = ctx->d; + result[13] = ctx->d >> 8; + result[14] = ctx->d >> 16; + result[15] = ctx->d >> 24; + + memset(ctx, 0, sizeof(*ctx)); +} + +#endif