summaryrefslogtreecommitdiff
path: root/plugin/auth_gssapi
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-08-11 13:58:32 +0200
committerSergei Golubchik <serg@mariadb.org>2017-08-24 01:05:48 +0200
commit828602356cb080046c72b5b48e78efde7d0e958a (patch)
tree1a053eb65fb5b9ef55b70338af6549e18192d5ee /plugin/auth_gssapi
parenta6e215f221b1ed71eba2f313fb0102647d84f854 (diff)
downloadmariadb-git-828602356cb080046c72b5b48e78efde7d0e958a.tar.gz
Don't include my_global.h in "pure" plugins
this partially reverts 6e56ebbb498
Diffstat (limited to 'plugin/auth_gssapi')
-rw-r--r--plugin/auth_gssapi/client_plugin.cc5
-rw-r--r--plugin/auth_gssapi/gssapi_client.cc3
-rw-r--r--plugin/auth_gssapi/gssapi_errmsg.cc1
-rw-r--r--plugin/auth_gssapi/gssapi_server.cc14
-rw-r--r--plugin/auth_gssapi/server_plugin.cc14
-rw-r--r--plugin/auth_gssapi/sspi_client.cc3
-rw-r--r--plugin/auth_gssapi/sspi_errmsg.cc3
-rw-r--r--plugin/auth_gssapi/sspi_server.cc9
8 files changed, 29 insertions, 23 deletions
diff --git a/plugin/auth_gssapi/client_plugin.cc b/plugin/auth_gssapi/client_plugin.cc
index 032300b5537..0ab619a08e6 100644
--- a/plugin/auth_gssapi/client_plugin.cc
+++ b/plugin/auth_gssapi/client_plugin.cc
@@ -31,12 +31,13 @@ POSSIBILITY OF SUCH DAMAGE.
GSSAPI authentication plugin, client side
*/
-#include <my_global.h>
+#include <string.h>
+#include <stdarg.h>
#include <mysqld_error.h>
#include <mysql/client_plugin.h>
#include <mysql.h>
+#include <stdio.h>
#include "common.h"
-#include <string.h>
extern int auth_client(char *principal_name,
char *mech,
diff --git a/plugin/auth_gssapi/gssapi_client.cc b/plugin/auth_gssapi/gssapi_client.cc
index 05ce62a31a3..a05ea158e4d 100644
--- a/plugin/auth_gssapi/gssapi_client.cc
+++ b/plugin/auth_gssapi/gssapi_client.cc
@@ -26,8 +26,9 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <my_global.h>
#include <gssapi/gssapi.h>
+#include <string.h>
+#include <stdio.h>
#include <mysql/plugin_auth.h>
#include <mysqld_error.h>
#include <mysql.h>
diff --git a/plugin/auth_gssapi/gssapi_errmsg.cc b/plugin/auth_gssapi/gssapi_errmsg.cc
index f92a03983ba..b0eee0e992e 100644
--- a/plugin/auth_gssapi/gssapi_errmsg.cc
+++ b/plugin/auth_gssapi/gssapi_errmsg.cc
@@ -26,7 +26,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <my_global.h>
#include <gssapi.h>
#include <string.h>
diff --git a/plugin/auth_gssapi/gssapi_server.cc b/plugin/auth_gssapi/gssapi_server.cc
index 269e5691da9..49d0262690e 100644
--- a/plugin/auth_gssapi/gssapi_server.cc
+++ b/plugin/auth_gssapi/gssapi_server.cc
@@ -1,9 +1,9 @@
-#include <my_global.h>
+#include <my_config.h>
#include <gssapi/gssapi.h>
+#include <stdio.h>
#include <mysql/plugin_auth.h>
-#include <my_sys.h>
#include <mysqld_error.h>
-#include <log.h>
+#include <string.h>
#include "server_plugin.h"
#include "gssapi_errmsg.h"
@@ -17,11 +17,11 @@ static void log_error( OM_uint32 major, OM_uint32 minor, const char *msg)
char sysmsg[1024];
gssapi_errmsg(major, minor, sysmsg, sizeof(sysmsg));
my_printf_error(ER_UNKNOWN_ERROR,"Server GSSAPI error (major %u, minor %u) : %s -%s",
- MYF(0), major, minor, msg, sysmsg);
+ 0, major, minor, msg, sysmsg);
}
else
{
- my_printf_error(ER_UNKNOWN_ERROR, "Server GSSAPI error : %s", MYF(0), msg);
+ my_printf_error(ER_UNKNOWN_ERROR, "Server GSSAPI error : %s", 0, msg);
}
}
@@ -196,7 +196,7 @@ int auth_server(MYSQL_PLUGIN_VIO *vio,const char *user, size_t userlen, int use_
/* send token to peer */
if (output.length)
{
- if (vio->write_packet(vio, (const uchar *) output.value, output.length))
+ if (vio->write_packet(vio, (const unsigned char *) output.value, output.length))
{
gss_release_buffer(&minor, &output);
log_error(major, minor, "communication error(write)");
@@ -236,7 +236,7 @@ int auth_server(MYSQL_PLUGIN_VIO *vio,const char *user, size_t userlen, int use_
{
my_printf_error(ER_ACCESS_DENIED_ERROR,
"GSSAPI name mismatch, requested '%s', actual name '%.*s'",
- MYF(0), user, (int)client_name_buf.length, client_name_str);
+ 0, user, (int)client_name_buf.length, client_name_str);
}
gss_release_buffer(&minor, &client_name_buf);
diff --git a/plugin/auth_gssapi/server_plugin.cc b/plugin/auth_gssapi/server_plugin.cc
index 5d6a92fe5ca..6ffcf5c65c1 100644
--- a/plugin/auth_gssapi/server_plugin.cc
+++ b/plugin/auth_gssapi/server_plugin.cc
@@ -31,10 +31,18 @@
GSSAPI authentication plugin, server side
*/
-#include <my_global.h>
-#include <my_sys.h>
+
+#ifdef _WIN32
+typedef unsigned __int64 my_ulonglong;
+#else
+typedef unsigned long long my_ulonglong;
+#endif
+
+#include <stdlib.h>
#include <mysqld_error.h>
+#include <typelib.h>
#include <mysql/plugin_auth.h>
+#include "string.h"
#include "server_plugin.h"
#include "common.h"
@@ -133,7 +141,7 @@ static const char* mech_names[] = {
NULL
};
static TYPELIB mech_name_typelib = {
- array_elements(mech_names) - 1,
+ 3,
"mech_name_typelib",
mech_names,
NULL
diff --git a/plugin/auth_gssapi/sspi_client.cc b/plugin/auth_gssapi/sspi_client.cc
index c9fb9d62fe5..61249dd1072 100644
--- a/plugin/auth_gssapi/sspi_client.cc
+++ b/plugin/auth_gssapi/sspi_client.cc
@@ -27,10 +27,11 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#define SECURITY_WIN32
-#include <my_global.h>
#include <windows.h>
#include <sspi.h>
#include <SecExt.h>
+#include <stdarg.h>
+#include <stdio.h>
#include <mysql/plugin_auth.h>
#include <mysql.h>
diff --git a/plugin/auth_gssapi/sspi_errmsg.cc b/plugin/auth_gssapi/sspi_errmsg.cc
index 48adad72677..961ef51f42e 100644
--- a/plugin/auth_gssapi/sspi_errmsg.cc
+++ b/plugin/auth_gssapi/sspi_errmsg.cc
@@ -26,9 +26,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <my_global.h>
#include <windows.h>
-#include <string.h>
+#include <stdio.h>
#define ERRSYM(x) {x, #x}
static struct {
diff --git a/plugin/auth_gssapi/sspi_server.cc b/plugin/auth_gssapi/sspi_server.cc
index 866e9d55c26..73c74c2e200 100644
--- a/plugin/auth_gssapi/sspi_server.cc
+++ b/plugin/auth_gssapi/sspi_server.cc
@@ -26,14 +26,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-#include <my_global.h>
#include "sspi.h"
#include "common.h"
#include "server_plugin.h"
#include <mysql/plugin_auth.h>
-#include <my_sys.h>
#include <mysqld_error.h>
-#include <log.h>
/* This sends the error to the client */
@@ -43,11 +40,11 @@ static void log_error(SECURITY_STATUS err, const char *msg)
{
char buf[1024];
sspi_errmsg(err, buf, sizeof(buf));
- my_printf_error(ER_UNKNOWN_ERROR, "SSPI server error 0x%x - %s - %s", MYF(0), msg, buf);
+ my_printf_error(ER_UNKNOWN_ERROR, "SSPI server error 0x%x - %s - %s", 0, msg, buf);
}
else
{
- my_printf_error(ER_UNKNOWN_ERROR, "SSPI server error %s", MYF(0), msg);
+ my_printf_error(ER_UNKNOWN_ERROR, "SSPI server error %s", 0, msg);
}
}
@@ -250,7 +247,7 @@ int auth_server(MYSQL_PLUGIN_VIO *vio, const char *user, size_t user_len, int co
{
my_printf_error(ER_ACCESS_DENIED_ERROR,
"GSSAPI name mismatch, requested '%s', actual name '%s'",
- MYF(0), user, client_name);
+ 0, user, client_name);
}
cleanup: