diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2019-07-03 16:41:01 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2019-07-03 16:41:01 +0400 |
commit | a099284b716b07af0d196705f44b828d621943d2 (patch) | |
tree | 543501fc7be433fbf4bbf530604a1b999c0abb17 /plugin | |
parent | bf37b9fce9fc1cfb3fe096bc50c15c1bf53cd629 (diff) | |
download | mariadb-git-a099284b716b07af0d196705f44b828d621943d2.tar.gz |
MDEV-19851 server_audit plugin should not allow server_audit_output_type=SYSLOG on Windows.
'syslog' output type disabled on Windows.
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/server_audit/server_audit.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c index 3da52643787..16a677e2644 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, |