summaryrefslogtreecommitdiff
path: root/plugin/auth_gssapi
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2018-02-06 12:55:58 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2018-02-06 12:55:58 +0000
commit6c279ad6a71c63cb595fde7c951aadb31c3dbebc (patch)
tree3603f88e1b3bd1e622edb182cccd882dd31ddc8a /plugin/auth_gssapi
parentf271100836d8a91a775894ec36b869a66a3145e5 (diff)
downloadmariadb-git-6c279ad6a71c63cb595fde7c951aadb31c3dbebc.tar.gz
MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from 'size_t' to 'type', possible loss of data)
Handle string length as size_t, consistently (almost always:)) Change function prototypes to accept size_t, where in the past ulong or uint were used. change local/member variables to size_t when appropriate. This fix excludes rocksdb, spider,spider, sphinx and connect for now.
Diffstat (limited to 'plugin/auth_gssapi')
-rw-r--r--plugin/auth_gssapi/server_plugin.cc2
-rw-r--r--plugin/auth_gssapi/sspi_errmsg.cc2
-rw-r--r--plugin/auth_gssapi/sspi_server.cc2
3 files changed, 3 insertions, 3 deletions
diff --git a/plugin/auth_gssapi/server_plugin.cc b/plugin/auth_gssapi/server_plugin.cc
index 6ffcf5c65c1..b991c764f05 100644
--- a/plugin/auth_gssapi/server_plugin.cc
+++ b/plugin/auth_gssapi/server_plugin.cc
@@ -110,7 +110,7 @@ static int initialize_plugin(void *unused)
strcpy(first_packet, srv_principal_name);
strcpy(first_packet + strlen(srv_principal_name) + 1,srv_mech_name);
- first_packet_len = strlen(srv_principal_name) + strlen(srv_mech_name) + 2;
+ first_packet_len = (int)(strlen(srv_principal_name) + strlen(srv_mech_name) + 2);
return 0;
}
diff --git a/plugin/auth_gssapi/sspi_errmsg.cc b/plugin/auth_gssapi/sspi_errmsg.cc
index 961ef51f42e..8e59da6f1ed 100644
--- a/plugin/auth_gssapi/sspi_errmsg.cc
+++ b/plugin/auth_gssapi/sspi_errmsg.cc
@@ -138,7 +138,7 @@ void sspi_errmsg(int err, char *buf, size_t size)
len = FormatMessageA(
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
err, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
- buf, size, NULL);
+ buf, (DWORD)size, NULL);
if(len > 0)
{
diff --git a/plugin/auth_gssapi/sspi_server.cc b/plugin/auth_gssapi/sspi_server.cc
index 73c74c2e200..140c6adf733 100644
--- a/plugin/auth_gssapi/sspi_server.cc
+++ b/plugin/auth_gssapi/sspi_server.cc
@@ -108,7 +108,7 @@ static int get_client_name_from_context(CtxtHandle *ctxt,
sspi_ret= ImpersonateSecurityContext(ctxt);
if (sspi_ret == SEC_E_OK)
{
- ULONG len= name_len;
+ ULONG len= (ULONG)name_len;
if (!GetUserNameEx(NameSamCompatible, name, &len))
{
log_error(GetLastError(), "GetUserNameEx");