Skip to content

Commit fc79442

Browse files
committed
PS-11143-[9.7] Fix compilation errors in acl_table_user.cc - proper port from 8.4
Remove native password handling code that references PLUGIN_MYSQL_NATIVE_PASSWORD and PLUGIN_SHA256_PASSWORD constants which are not available in 9.7+. This code block was ported from 8.4 branch during cherrypick but the referenced constants and native password plugin were removed in 9.7 architecture. The code was handling legacy 5.6 database layout upgrades, which is no longer needed or supported in 9.7+. Fixes compilation errors: - 'is_old_db_layout' was not declared in this scope - 'PLUGIN_MYSQL_NATIVE_PASSWORD' was not declared in this scope; did you mean 'PLUGIN_SHA256_PASSWORD'? The cherrypick properly removed the parameter from function signatures in 9.7, but this code block that used it was incorrectly left behind. Please squash it later with prev PS-11143-[9.7]
1 parent c701830 commit fc79442

1 file changed

Lines changed: 0 additions & 50 deletions

File tree

sql/auth/acl_table_user.cc

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,56 +1629,6 @@ bool Acl_table_user_reader::read_plugin_info(
16291629
user.plugin.str = tmpstr ? tmpstr : "";
16301630
user.plugin.length = strlen(user.plugin.str);
16311631

1632-
/*
1633-
In case we are working with 5.6 db layout we need to make server
1634-
aware of Password field and that the plugin column can be null.
1635-
In case when plugin column is null we use native password plugin
1636-
if we can.
1637-
*/
1638-
if (is_old_db_layout && (user.plugin.length == 0 ||
1639-
Cached_authentication_plugins::compare_plugin(
1640-
PLUGIN_MYSQL_NATIVE_PASSWORD, user.plugin))) {
1641-
char *password = get_field(
1642-
&m_mem_root, m_table->field[m_table_schema->password_idx()]);
1643-
1644-
// We do not support pre 4.1 hashes
1645-
plugin_ref native_plugin =
1646-
g_cached_authentication_plugins->get_cached_plugin_ref(
1647-
PLUGIN_MYSQL_NATIVE_PASSWORD);
1648-
if (native_plugin) {
1649-
const uint password_len = password ? strlen(password) : 0;
1650-
st_mysql_auth *auth = (st_mysql_auth *)plugin_decl(native_plugin)->info;
1651-
Auth_plugin_operation_guard op_guard;
1652-
if (!op_guard) {
1653-
LogErr(WARNING_LEVEL, ER_AUTHCACHE_USER_IGNORED_INVALID_PASSWORD,
1654-
user.user ? user.user : "",
1655-
user.host.get_host() ? user.host.get_host() : "");
1656-
return true;
1657-
}
1658-
if (auth->validate_authentication_string(password, password_len) == 0) {
1659-
// auth_string takes precedence over password
1660-
if (user.credentials[PRIMARY_CRED].m_auth_string.length == 0) {
1661-
user.credentials[PRIMARY_CRED].m_auth_string.str = password;
1662-
user.credentials[PRIMARY_CRED].m_auth_string.length = password_len;
1663-
}
1664-
if (user.plugin.length == 0) {
1665-
user.plugin.str = Cached_authentication_plugins::get_plugin_name(
1666-
PLUGIN_MYSQL_NATIVE_PASSWORD);
1667-
user.plugin.length = strlen(user.plugin.str);
1668-
}
1669-
} else {
1670-
if ((user.access & SUPER_ACL) && !super_users_with_empty_plugin &&
1671-
(user.plugin.length == 0))
1672-
super_users_with_empty_plugin = true;
1673-
1674-
LogErr(WARNING_LEVEL, ER_AUTHCACHE_USER_IGNORED_DEPRECATED_PASSWORD,
1675-
user.user ? user.user : "",
1676-
user.host.get_host() ? user.host.get_host() : "");
1677-
return true;
1678-
}
1679-
}
1680-
}
1681-
16821632
/*
16831633
Check if the plugin string is blank or null.
16841634
If it is, the user will be skipped.

0 commit comments

Comments
 (0)