diff --git a/include/audit_handler.h b/include/audit_handler.h index 9726cd8..568a0d3 100644 --- a/include/audit_handler.h +++ b/include/audit_handler.h @@ -185,7 +185,7 @@ public: { //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 (MYSQL_VERSION_ID >= 50534 && MYSQL_VERSION_ID < 50600) || (MYSQL_VERSION_ID >= 50614) +#if ( !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50534 && MYSQL_VERSION_ID < 50600) || (MYSQL_VERSION_ID >= 50614) return sctx->get_host()->ptr(); #else return sctx->host; @@ -201,7 +201,7 @@ public: 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 (MYSQL_VERSION_ID >= 50534 && MYSQL_VERSION_ID < 50600) || (MYSQL_VERSION_ID >= 50614) +#if ( !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50534 && MYSQL_VERSION_ID < 50600) || (MYSQL_VERSION_ID >= 50614) return sctx->get_ip()->ptr(); #else return sctx->ip; diff --git a/include/mysql_inc.h b/include/mysql_inc.h old mode 100755 new mode 100644 index 1fea13f..069f5a2 --- a/include/mysql_inc.h +++ b/include/mysql_inc.h @@ -5,7 +5,7 @@ #define HAVE_CONFIG_H #endif -#define MYSQL_DYNAMIC_PLUGIN +#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 @@ -62,6 +62,13 @@ # endif #endif +//MariaDB doesn't have my_getsystime function. They replaced with my_hrtime_t my_hrtime() +#if defined(MARIADB_BASE_VERSION) +#define my_getsystime() (my_hrtime()).val +//MariaDB has a kill service that overrides thd_killed. It also has thd_killed function defined so redefine it. +#undef thd_killed +extern "C" int thd_killed(const MYSQL_THD thd); +#endif #endif //MYSQL_INCL_H diff --git a/src/audit_plugin.cc b/src/audit_plugin.cc index 8b3f2a9..ff63b96 100644 --- a/src/audit_plugin.cc +++ b/src/audit_plugin.cc @@ -375,7 +375,15 @@ static const ThdOffsets thd_offsets_arr[] = //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} + {"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} }; #else @@ -694,7 +702,15 @@ static const ThdOffsets thd_offsets_arr[] = //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} + {"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} }; #endif