[Commits] a099284: MDEV-19851 server_audit plugin should not allow server_audit_output_type=SYSLOG on Windows.

Alexey Botchkov holyfoot at askmonty.org
Wed Jul 3 15:42:10 EEST 2019


revision-id: a099284b716b07af0d196705f44b828d621943d2 (mariadb-10.1.39-80-ga099284)
parent(s): bf37b9fce9fc1cfb3fe096bc50c15c1bf53cd629
committer: Alexey Botchkov
timestamp: 2019-07-03 16:41:01 +0400
message:

MDEV-19851 server_audit plugin should not allow server_audit_output_type=SYSLOG on Windows.

'syslog' output type disabled on Windows.

---
 plugin/server_audit/server_audit.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c
index 3da5264..16a677e 100644
--- a/plugin/server_audit/server_audit.c
+++ b/plugin/server_audit/server_audit.c
@@ -26,6 +26,7 @@
 #include <fcntl.h>
 
 #ifndef _WIN32
+#define DO_SYSLOG
 #include <syslog.h>
 #else
 #define syslog(PRIORITY, FORMAT, INFO, MESSAGE_LEN, MESSAGE) do {}while(0)
@@ -384,17 +385,31 @@ static MYSQL_SYSVAR_SET(events, events, PLUGIN_VAR_RQCMDARG,
        "Specifies the set of events to monitor. Can be CONNECT, QUERY, TABLE,"
            " QUERY_DDL, QUERY_DML, QUERY_DML_NO_SELECT, QUERY_DCL.",
        NULL, NULL, 0, &events_typelib);
+#ifdef DO_SYSLOG
 #define OUTPUT_SYSLOG 0
 #define OUTPUT_FILE 1
+#else
+#define OUTPUT_SYSLOG 0xFFFF
+#define OUTPUT_FILE 0
+#endif /*DO_SYSLOG*/
+
 #define OUTPUT_NO 0xFFFF
-static const char *output_type_names[]= { "syslog", "file", 0 };
+static const char *output_type_names[]= {
+#ifdef DO_SYSLOG
+  "syslog",
+#endif
+  "file", 0 };
 static TYPELIB output_typelib=
 {
     array_elements(output_type_names) - 1, "output_typelib",
     output_type_names, NULL
 };
 static MYSQL_SYSVAR_ENUM(output_type, output_type, PLUGIN_VAR_RQCMDARG,
+#ifdef DO_SYSLOG
        "Desired output type. Possible values - 'syslog', 'file'"
+#else
+       "Desired output type. Possible values - 'file'"
+#endif
        " or 'null' as no output.", 0, update_output_type, OUTPUT_FILE,
        &output_typelib);
 static MYSQL_SYSVAR_STR(file_path, file_path, PLUGIN_VAR_RQCMDARG,


More information about the commits mailing list