From ec419ab70a46dfa646a9b1baea2a2bd157101448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Sun, 16 Nov 2014 14:53:11 +0100 Subject: [PATCH] Add daemon plugin for Bug #68858 Exposes default_authentication_plugin as a read-only var --- plugin/def_auth_var/CMakeLists.txt | 17 ++++++++++++ plugin/def_auth_var/def_auth_var.cc | 53 +++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 plugin/def_auth_var/CMakeLists.txt create mode 100644 plugin/def_auth_var/def_auth_var.cc diff --git a/plugin/def_auth_var/CMakeLists.txt b/plugin/def_auth_var/CMakeLists.txt new file mode 100644 index 0000000..f103960 --- /dev/null +++ b/plugin/def_auth_var/CMakeLists.txt @@ -0,0 +1,17 @@ +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +MYSQL_ADD_PLUGIN(def_auth_var def_auth_var.cc + MODULE_ONLY MODULE_OUTPUT_NAME "libdef_auth_var") diff --git a/plugin/def_auth_var/def_auth_var.cc b/plugin/def_auth_var/def_auth_var.cc new file mode 100644 index 0000000..44af085 --- /dev/null +++ b/plugin/def_auth_var/def_auth_var.cc @@ -0,0 +1,53 @@ +/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include +#include +#include + +extern LEX_STRING default_auth_plugin_name; + +static MYSQL_SYSVAR_STR(default_authentication_plugin, default_auth_plugin_name.str, + PLUGIN_VAR_READONLY, + "Default authentication plugin", + NULL, NULL, NULL); + +struct st_mysql_sys_var* def_auth_var_sysvars[] = { + MYSQL_SYSVAR(default_authentication_plugin), + NULL +}; + +struct st_mysql_daemon def_auth_var_plugin= +{ + MYSQL_DAEMON_INTERFACE_VERSION +}; + +mysql_declare_plugin(def_auth_var) +{ + MYSQL_DAEMON_PLUGIN, + &def_auth_var_plugin, + "def_auth_var", + "Daniƫl van Eeden", + "Exposes default_authentication_plugin", + PLUGIN_LICENSE_GPL, + NULL, /* Plugin Init */ + NULL, /* Plugin Deinit */ + 0x0100 /* 1.0 */, + NULL, /* status variables */ + def_auth_var_sysvars, /* system variables */ + NULL, /* config options */ + 0, /* flags */ +} +mysql_declare_plugin_end; -- 2.1.0