mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.1 into 10.2
Also, include fixes by Vladislav Vaintroub to the aws_key_management plugin. The AWS C++ SDK specifically depends on OPENSSL_LIBRARIES, not generic SSL_LIBRARIES (such as YaSSL).
This commit is contained in:
@@ -44,26 +44,30 @@ static char* get_default_principal_name()
|
||||
|
||||
if(krb5_init_context(&context))
|
||||
{
|
||||
sql_print_warning("GSSAPI plugin : krb5_init_context failed");
|
||||
my_printf_error(0, "GSSAPI plugin : krb5_init_context failed",
|
||||
ME_ERROR_LOG | ME_WARNING);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (krb5_sname_to_principal(context, NULL, "mariadb", KRB5_NT_SRV_HST, &principal))
|
||||
{
|
||||
sql_print_warning("GSSAPI plugin : krb5_sname_to_principal failed");
|
||||
my_printf_error(0, "GSSAPI plugin : krb5_sname_to_principal failed",
|
||||
ME_ERROR_LOG | ME_WARNING);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (krb5_unparse_name(context, principal, &unparsed_name))
|
||||
{
|
||||
sql_print_warning("GSSAPI plugin : krb5_unparse_name failed");
|
||||
my_printf_error(0, "GSSAPI plugin : krb5_unparse_name failed",
|
||||
ME_ERROR_LOG | ME_WARNING);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Check for entry in keytab */
|
||||
if (krb5_kt_read_service_key(context, NULL, principal, 0, (krb5_enctype)0, &key))
|
||||
{
|
||||
sql_print_warning("GSSAPI plugin : default principal '%s' not found in keytab", unparsed_name);
|
||||
my_printf_error(0, "GSSAPI plugin : default principal '%s' not found in keytab",
|
||||
ME_ERROR_LOG | ME_WARNING, unparsed_name);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -100,7 +104,8 @@ int plugin_init()
|
||||
/* import service principal from plain text */
|
||||
if(srv_principal_name && srv_principal_name[0])
|
||||
{
|
||||
sql_print_information("GSSAPI plugin : using principal name '%s'", srv_principal_name);
|
||||
my_printf_error(0, "GSSAPI plugin : using principal name '%s'",
|
||||
ME_ERROR_LOG | ME_NOTE, srv_principal_name);
|
||||
principal_name_buf.length= strlen(srv_principal_name);
|
||||
principal_name_buf.value= srv_principal_name;
|
||||
major= gss_import_name(&minor, &principal_name_buf, GSS_C_NT_USER_NAME, &service_name);
|
||||
@@ -115,8 +120,6 @@ int plugin_init()
|
||||
service_name= GSS_C_NO_NAME;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Check if SPN configuration is OK */
|
||||
major= gss_acquire_cred(&minor, service_name, GSS_C_INDEFINITE,
|
||||
GSS_C_NO_OID_SET, GSS_C_ACCEPT, &cred, NULL,
|
||||
|
@@ -284,8 +284,8 @@ int plugin_init()
|
||||
{
|
||||
srv_principal_name= get_default_principal_name();
|
||||
}
|
||||
sql_print_information("SSPI: using principal name '%s', mech '%s'",
|
||||
srv_principal_name, srv_mech_name);
|
||||
my_printf_error(0, "SSPI: using principal name '%s', mech '%s'",
|
||||
ME_ERROR_LOG | ME_NOTE, srv_principal_name, srv_mech_name);
|
||||
|
||||
ret = AcquireCredentialsHandle(
|
||||
srv_principal_name,
|
||||
|
Reference in New Issue
Block a user