Commit a099284b authored by Alexey Botchkov's avatar Alexey Botchkov

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

'syslog' output type disabled on Windows.
parent bf37b9fc
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <fcntl.h> #include <fcntl.h>
#ifndef _WIN32 #ifndef _WIN32
#define DO_SYSLOG
#include <syslog.h> #include <syslog.h>
#else #else
#define syslog(PRIORITY, FORMAT, INFO, MESSAGE_LEN, MESSAGE) do {}while(0) #define syslog(PRIORITY, FORMAT, INFO, MESSAGE_LEN, MESSAGE) do {}while(0)
...@@ -384,17 +385,31 @@ static MYSQL_SYSVAR_SET(events, events, PLUGIN_VAR_RQCMDARG, ...@@ -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," "Specifies the set of events to monitor. Can be CONNECT, QUERY, TABLE,"
" QUERY_DDL, QUERY_DML, QUERY_DML_NO_SELECT, QUERY_DCL.", " QUERY_DDL, QUERY_DML, QUERY_DML_NO_SELECT, QUERY_DCL.",
NULL, NULL, 0, &events_typelib); NULL, NULL, 0, &events_typelib);
#ifdef DO_SYSLOG
#define OUTPUT_SYSLOG 0 #define OUTPUT_SYSLOG 0
#define OUTPUT_FILE 1 #define OUTPUT_FILE 1
#else
#define OUTPUT_SYSLOG 0xFFFF
#define OUTPUT_FILE 0
#endif /*DO_SYSLOG*/
#define OUTPUT_NO 0xFFFF #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= static TYPELIB output_typelib=
{ {
array_elements(output_type_names) - 1, "output_typelib", array_elements(output_type_names) - 1, "output_typelib",
output_type_names, NULL output_type_names, NULL
}; };
static MYSQL_SYSVAR_ENUM(output_type, output_type, PLUGIN_VAR_RQCMDARG, static MYSQL_SYSVAR_ENUM(output_type, output_type, PLUGIN_VAR_RQCMDARG,
#ifdef DO_SYSLOG
"Desired output type. Possible values - 'syslog', 'file'" "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, " or 'null' as no output.", 0, update_output_type, OUTPUT_FILE,
&output_typelib); &output_typelib);
static MYSQL_SYSVAR_STR(file_path, file_path, PLUGIN_VAR_RQCMDARG, static MYSQL_SYSVAR_STR(file_path, file_path, PLUGIN_VAR_RQCMDARG,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment