Permalink
Browse files

Initial Commit

  • Loading branch information...
0 parents commit 92a9278eff1358fc691a0892ca161c2a471ae4c3 @guylichtman guylichtman committed Feb 27, 2012
Showing with 16,561 additions and 0 deletions.
  1. +352 −0 COPYING
  2. +9 −0 Makefile.am
  3. +104 −0 README.txt
  4. +62 −0 THIRDPARTY.txt
  5. +2 −0 bootstrap.sh
  6. +63 −0 compiling.txt
  7. +99 −0 config/ac_mysql.m4
  8. +133 −0 configure.ac
  9. +440 −0 include/audit_handler.h
  10. +84 −0 include/hot_patch.h
  11. +51 −0 include/mysql_inc.h
  12. +43 −0 include/static_assert.h
  13. +28 −0 src/Makefile.am
  14. +527 −0 src/audit_handler.cc
  15. +1,516 −0 src/audit_plugin.cc
  16. +268 −0 src/hot_patch.cc
  17. +234 −0 udis86/INSTALL
  18. +22 −0 udis86/LICENSE
  19. +2 −0 udis86/Makefile.am
  20. +17 −0 udis86/Makefile.am.org
  21. +1 −0 udis86/README
  22. +1 −0 udis86/VERSION
  23. BIN udis86/docs/._udis86.odt
  24. BIN udis86/docs/._udis86.pdf
  25. +1 −0 udis86/docs/Makefile.am
  26. +356 −0 udis86/docs/Makefile.in
  27. +84 −0 udis86/docs/index.html
  28. BIN udis86/docs/ss.jpg
  29. +67 −0 udis86/docs/style.css
  30. BIN udis86/docs/udis86.odt
  31. BIN udis86/docs/udis86.pdf
  32. +3,093 −0 udis86/docs/x86optable.xml
  33. +63 −0 udis86/docs/x86optable.xsl
  34. +24 −0 udis86/libudis86/Makefile.am
  35. +30 −0 udis86/libudis86/Makefile.am.org
  36. +1,193 −0 udis86/libudis86/decode.c
  37. +275 −0 udis86/libudis86/decode.h
  38. +67 −0 udis86/libudis86/extern.h
  39. +226 −0 udis86/libudis86/input.c
  40. +49 −0 udis86/libudis86/input.h
  41. +603 −0 udis86/libudis86/opgen.py
  42. +211 −0 udis86/libudis86/syn-att.c
  43. +208 −0 udis86/libudis86/syn-intel.c
  44. +61 −0 udis86/libudis86/syn.c
  45. +25 −0 udis86/libudis86/syn.h
  46. +200 −0 udis86/libudis86/types.h
  47. +154 −0 udis86/libudis86/udis86.c
  48. +16 −0 udis86/udis86.h
  49. +2 −0 yajl/.gitignore
  50. +23 −0 yajl/BUILDING
  51. +12 −0 yajl/BUILDING.win32
  52. +88 −0 yajl/CMakeLists.txt
  53. +29 −0 yajl/COPYING
  54. +119 −0 yajl/ChangeLog
  55. +7 −0 yajl/Makefile.am
  56. +68 −0 yajl/README
  57. +9 −0 yajl/TODO
  58. +1 −0 yajl/VERSION
  59. +26 −0 yajl/YAJLDoc.cmake
  60. +94 −0 yajl/configure
  61. +85 −0 yajl/include/yajl/yajl_common.h
  62. +159 −0 yajl/include/yajl/yajl_gen.h
  63. +193 −0 yajl/include/yajl/yajl_parse.h
  64. +23 −0 yajl/include/yajl/yajl_version.h
  65. +90 −0 yajl/src/CMakeLists.txt
  66. +37 −0 yajl/src/Makefile.am
  67. +1,258 −0 yajl/src/YAJL.dxy
  68. +85 −0 yajl/src/api/yajl_common.h
  69. +159 −0 yajl/src/api/yajl_gen.h
  70. +193 −0 yajl/src/api/yajl_parse.h
  71. +23 −0 yajl/src/api/yajl_version.h.cmake
  72. +196 −0 yajl/src/yajl
  73. +159 −0 yajl/src/yajl.c
  74. +65 −0 yajl/src/yajl_alloc.c
  75. +50 −0 yajl/src/yajl_alloc.h
  76. +119 −0 yajl/src/yajl_buf.c
  77. +73 −0 yajl/src/yajl_buf.h
  78. +85 −0 yajl/src/yajl_bytestack.h
  79. +188 −0 yajl/src/yajl_encode.c
  80. +50 −0 yajl/src/yajl_encode.h
  81. +322 −0 yajl/src/yajl_gen.c
  82. +737 −0 yajl/src/yajl_lex.c
  83. +133 −0 yajl/src/yajl_lex.h
  84. +448 −0 yajl/src/yajl_parser.c
  85. +82 −0 yajl/src/yajl_parser.h
  86. +7 −0 yajl/src/yajl_version.c
352 COPYING

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,9 @@
+## top-level Makefile.am
+
+#Build in these directories:
+SUBDIRS = yajl udis86 src
+
+#Distribute these directories:
+DIST_SUBDIRS = $(SUBDIRS)
+
+
@@ -0,0 +1,104 @@
+Audit Plugin
+
+This is a release of Audit Plugin for MySQL 5.1 and 5.5.
+
+Audit Plugin is brought to you by McAfee, Inc (www.mcafee.com).
+
+
+==== INSTALLATION =====
+
+Make sure to download the proper binary distribution. There are separate binaries for MySQL 5.1 and 5.5 according
+to platform (32 or 64 bit).
+
+Audit Plugin is available in the binary distribution under the lib dir. File name: libaudit_plugin.so.
+To install Audit Plugin, copy libaudit_plugin.so to the plugin_dir (for example /usr/lib/mysql/plugin or /usr/lib64/mysql/plugin) of MySQL.
+
+To see the configured plugin dir login to MySQL and issue the following command:
+
+show global variables like 'plugin_dir';
+
+There are 2 options for installing the plugin via plugin-load configuration option or by issuing the
+INSTALL PLUGIN statement.
+
+* Installing via: plugin-load
+
+Add to the MySQL option file (my.cnf) at the [mysqld] section the option:
+plugin-load=AUDIT=libaudit_plugin.so
+
+Restart the mysqld server for the changes to take effect.
+
+* Installing via: INSTALL PLUGIN
+
+You will need to issue the following sql command to install the plugin:
+
+INSTALL PLUGIN AUDIT SONAME 'libaudit_plugin.so';
+
+A restart to the mysqld server is not necessary.
+
+Note: On production systems, McAfee recommends using the plugin-load option for installing
+the audit plugin.
+
+More info on installing MySQL plugins is available at:
+http://dev.mysql.com/doc/refman/5.1/en/plugin-installing-uninstalling.html
+
+===== VERIFICATION =====
+
+To check if the plugin is installed successfully you can issue the following command, which will show all installed plugins:
+
+show plugins;
+
+The Audit plugin will show up with the name AUDIT.
+
+Additionally you can verify the version of the Audit Plugin by running the following command:
+
+show global status like 'AUDIT_version';
+
+
+===== CONFIGURATION =====
+
+By default, after installation the Audit Plugin doesn't log activity. You must explicitly enable
+the type of logging desired. Configuration is done through the use of MySQL system variables.
+Audit Plugin system variables can be set at server startup using options on the command line or in an option file.
+Additionally, the Audit Plugin system variables can be changed dynamically while the server is running
+by means of the SET statement.
+
+Available Audit Plugin command line options:
+
+--audit-json-file AUDIT plugin json log file Enable|Disable
+--audit-json-file-sync=#
+ AUDIT plugin json log file sync period. If the value of
+ this variable is greater than 0, audit log will sync to
+ disk after every audit_json_file_sync writes.
+--audit-json-log-file=name
+ AUDIT plugin json log file name
+--audit-json-socket AUDIT plugin json log unix socket Enable|Disable
+--audit-json-socket-name=name
+ AUDIT plugin json log unix socket name
+--audit-uninstall-plugin
+ AUDIT uninstall plugin Enable|Disable.
+ If disabled attempts to uninstall the AUDIT plugin via the sql UNINSTALL command will fail.
+ Provides added security from uninstalling the plugin. Also protection from
+ CVE-2010-1621 (http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-1621)
+ affecting versions upto 5.1.46.
+
+
+===== REPORTING BUGS =====
+
+Please describe the problem verbosely. Try to see if it reproduces and
+include a detailed description on how to reproduce.
+
+Make sure to include your MySQL Server version and Audit Plugin version.
+To print MySQL Server version log into MySQL and execute the command: status.
+
+Please include with the bug the log files:
+
+* mysql-audit.log
+* MySQL error log: log file location can be queried by running the following
+ command: show global variables like 'log_error'
+
+
+===== LICENSE =====
+
+The software included in this product contains copyrighted software that is licensed under the GPL Version 2.
+See COPYING file for a copy of the GPL Version 2 license.
+Source code is available at: https://github.com/mcafee/mysql-audit
@@ -0,0 +1,62 @@
+This is a list of third party software that may be included with this product.
+
+%% The following software may be included in this product: libudis86 (http://udis86.sourceforge.net/)
+
+Use of any of this software is governed by the terms of the license below:
+
+Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 <vivek@sig9.com>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+%% The following software may be included in this product: YAJL 1.0 (http://lloyd.github.com/yajl/)
+
+Use of any of this software is governed by the terms of the license below:
+
+Copyright 2010, Lloyd Hilaiel.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ 3. Neither the name of Lloyd Hilaiel nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,2 @@
+#!/bin/sh
+autoreconf -fvi
@@ -0,0 +1,63 @@
+Compiling instructions:
+
+make sure you have installed the following packages:
+
+autoconf
+automake
+gcc-c++
+
+To compile you will need to obtain the MySQL source code.
+
+==== MySQL 5.1 ======
+
+Extract the MySQL source code in the root directory. For example:
+
+unzip zip-sources/mysql-5.1.40.zip
+
+
+Then run the following command:
+
+cd mysql-5.1.40
+CXX=gcc ./configure
+cd include
+make
+
+Then goto top dir and run:
+
+chmod +x bootstrap.sh
+./bootstrap.sh
+
+This will create configure script. Then run:
+
+CXX='gcc -static-libgcc' CC='gcc -static-libgcc' ./configure --with-mysql=mysql-5.1.40
+
+
+==== MySQL 5.5 ======
+
+Extract MySQL 5.5 source code
+
+go to mysql-src dir and run:
+
+cd mysql-5.5.8
+cmake .
+make
+
+back to working dir and run:
+
+CXX='gcc -static-libgcc' CC='gcc -static-libgcc' ./configure --with-mysql=mysql-5.5.8 --with-mysql-libservices=mysql-5.5.8/libservices/libmysqlservices.a
+make
+
+==== Compiling with make =====
+
+Go to top source dir and run:
+
+make
+
+Plugin will be compiled at:
+
+src/.libs/libaudit_plugin.so
+
+Some documentation about configure command for mysql:
+
+http://dev.mysql.com/doc/refman/5.1/en/source-configuration-options.html
+
@@ -0,0 +1,99 @@
+dnl ---------------------------------------------------------------------------
+dnl Macro: MYSQL_SRC_TEST
+dnl ---------------------------------------------------------------------------
+
+dir_resolve() dnl {{{
+{
+ pwd=`pwd`
+ cd "$1" 2>/dev/null || cd "${pwd}/${1}" 2>/dev/null
+ if test "$?" = "0"; then
+ echo `pwd -P`
+ else
+ echo "$1"
+ fi
+}
+dnl }}}
+
+AC_DEFUN([MYSQL_SRC_TEST], [
+ AC_MSG_CHECKING(for mysql source code)
+ AC_ARG_WITH(mysql,
+ [AS_HELP_STRING([--with-mysql=PATH], [MySQL src directory required to build.])],
+ [
+ withval=`dir_resolve "$withval"`
+ ac_mysql_source_dir="$withval"
+ HEADERS="include/my_dir.h include/mysql/plugin.h include/mysql.h include/mysql_version.h include/config.h include/my_config.h"
+ for file in $HEADERS; do
+ if ! test -r "$withval/$file"; then
+ AC_MSG_ERROR([Failed to find required header file $file in $withval, check the path and make sure you've run './configure ..<options>.. && cd include && make' in MySQL 5.1 sources dir or 'cmake . && make' in MySQL 5.5 sources dir.])
+ fi
+ done
+ AC_DEFINE([MYSQL_SRC], [1], [Source directory for MySQL])
+ MYSQL_INC="-I$withval/sql -I$withval/include -I$withval/regex -I$withval"
+ AC_MSG_RESULT(["$withval"])
+ ],
+ [
+ AC_MSG_ERROR(["No mysql source provided. Please specify --with-mysql=<mysql source dir>!"])
+ ])
+])
+
+dnl ---------------------------------------------------------------------------
+dnl Macro: MYSQL_PLUGIN_DIR_TEST
+dnl ---------------------------------------------------------------------------
+
+AC_DEFUN([MYSQL_PLUGIN_DIR_TEST], [
+ AC_MSG_CHECKING([for mysql plugin dir])
+ ac_mysql_plugin_dir=
+ AC_ARG_WITH([mysql-plugindir],
+ [AS_HELP_STRING([--with-mysql-plugindir=PATH], [MySQL plugin directory where audit plugin is to be copied to])],
+ [
+ ac_mysql_plugin_dir=`dir_resolve "$withval"`
+ if test -d "$ac_mysql_plugin_dir/" ; then
+ MYSQL_PLUGIN_DIR="$ac_mysql_plugin_dir"
+ AC_MSG_RESULT([yes: Using $ac_mysql_plugin_dir])
+ else
+ AC_MSG_ERROR([invalid MySQL plugin directory : $ac_mysql_plugin_dir])
+ fi
+ ],
+ [
+ ac_mysql_plugin_dir=/usr/lib/mysql/plugin
+ MYSQL_PLUGIN_DIR="$ac_mysql_plugin_dir"
+ AC_MSG_RESULT([--with-mysql-plugindir was not set. Using $ac_mysql_plugin_dir])
+ ]
+ )
+])
+
+
+dnl ---------------------------------------------------------------------------
+dnl Macro: MYSQL_LIB_SERVICES : 5.5 services lib to add to linker
+dnl ---------------------------------------------------------------------------
+
+AC_DEFUN([MYSQL_LIB_SERVICES_TEST], [
+ AC_MSG_CHECKING([for mysql libmysqlservices])
+ ac_mysql_libservices=
+ AC_ARG_WITH([mysql-libservices],
+ [AS_HELP_STRING([--with-mysql-libservices=PATH], [MySQL libmysqlservices.a location (relevant for 5.5 only)])],
+ [
+ t_lib_dir=`dirname "$withval"`
+ t_lib_dir=`dir_resolve "$t_lib_dir"`
+ t_lib_file=`basename "$withval"`
+ ac_mysql_libservices="$t_lib_dir/$t_lib_file"
+ if test -f "$ac_mysql_libservices" ; then
+ MYSQL_LIBSERVICES="$ac_mysql_libservices"
+ AC_MSG_RESULT([yes: Using $ac_mysql_libservices])
+ else
+ AC_MSG_ERROR([invalid MySQL libmysqlservices : $ac_mysql_libservices])
+ fi
+ ],
+ [
+ if test -f "$ac_mysql_source_dir/VERSION"; then
+ source "$ac_mysql_source_dir/VERSION"
+ if test "$MYSQL_VERSION_MAJOR.$MYSQL_VERSION_MINOR" = "5.5"; then
+ AC_MSG_ERROR([no mysql-libservices. Required for MySQL 5.5])
+ fi
+ fi
+ ac_mysql_libservices=""
+ MYSQL_LIBSERVICES="$ac_mysql_libservices"
+ AC_MSG_RESULT([--with-mysql-libservices was not set.])
+ ]
+ )
+])
Oops, something went wrong.

0 comments on commit 92a9278

Please sign in to comment.