| 1007 | LEX_CSTRING& name() const override { return MYSQL_TABLE_NAME_USER; } |
| 1008 | |
| 1009 | int get_auth(THD *thd, MEM_ROOT *root, ACL_USER *u) const override |
| 1010 | { |
| 1011 | mysql_mutex_assert_owner(&acl_cache->lock); |
| 1012 | u->alloc_auth(root, 1); |
| 1013 | if (have_password()) |
| 1014 | { |
| 1015 | const char *as= safe_str(::get_field(&acl_memroot, password())); |
| 1016 | u->auth->auth_string.str= as; |
| 1017 | u->auth->auth_string.length= strlen(as); |
| 1018 | u->auth->plugin= guess_auth_plugin(thd, u->auth->auth_string.length); |
| 1019 | } |
| 1020 | else |
| 1021 | { |
| 1022 | u->auth->plugin= native_password_plugin_name; |
| 1023 | u->auth->auth_string= empty_clex_str; |
| 1024 | } |
| 1025 | if (plugin() && authstr()) |
| 1026 | { |
| 1027 | char *tmpstr= ::get_field(&acl_memroot, plugin()); |
| 1028 | if (tmpstr) |
| 1029 | { |
| 1030 | const char *pw= u->auth->auth_string.str; |
| 1031 | const char *as= safe_str(::get_field(&acl_memroot, authstr())); |
| 1032 | if (*pw) |
| 1033 | { |
| 1034 | if (*as && strcmp(as, pw)) |
| 1035 | { |
| 1036 | sql_print_warning("'user' entry '%s@%s' has both a password and an " |
| 1037 | "authentication plugin specified. The password will be ignored.", |
| 1038 | safe_str(get_user(thd->mem_root)), safe_str(get_host(thd->mem_root))); |
| 1039 | } |
| 1040 | else |
| 1041 | as= pw; |
| 1042 | } |
| 1043 | u->auth->plugin.str= tmpstr; |
| 1044 | u->auth->plugin.length= strlen(tmpstr); |
| 1045 | u->auth->auth_string.str= as; |
| 1046 | u->auth->auth_string.length= strlen(as); |
| 1047 | } |
| 1048 | } |
| 1049 | return 0; |
| 1050 | } |
| 1051 | |
| 1052 | bool set_auth(const ACL_USER &u) const override |
| 1053 | { |
nothing calls this directly
no test coverage detected