79
80
check_user(THD *thd, enum enum_server_command command,
80
const char *passwd __attribute__((unused)),
81
82
uint passwd_len, const char *db,
84
85
LEX_STRING db_str= { (char *) db, db ? strlen(db) : 0 };
86
bool is_authenticated;
87
89
Clear thd->db as it points to something, that will be freed when
92
94
thd->reset_db(NULL, 0);
94
bool opt_secure_auth_local;
95
pthread_mutex_lock(&LOCK_global_system_variables);
96
opt_secure_auth_local= opt_secure_auth;
97
pthread_mutex_unlock(&LOCK_global_system_variables);
100
If the server is running in secure auth mode, short scrambles are
103
if (opt_secure_auth_local && passwd_len == SCRAMBLE_LENGTH_323)
105
my_error(ER_NOT_SUPPORTED_AUTH_MODE, MYF(0));
106
general_log_print(thd, COM_CONNECT, ER(ER_NOT_SUPPORTED_AUTH_MODE));
109
if (passwd_len != 0 &&
110
passwd_len != SCRAMBLE_LENGTH &&
111
passwd_len != SCRAMBLE_LENGTH_323)
96
if (passwd_len != 0 && passwd_len != SCRAMBLE_LENGTH)
113
98
my_error(ER_HANDSHAKE_ERROR, MYF(0), thd->main_security_ctx.host_or_ip);
102
is_authenticated= authenticate_user(thd, passwd);
104
if (is_authenticated != true)
106
my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
107
thd->main_security_ctx.user,
108
thd->main_security_ctx.host_or_ip,
109
passwd_len ? ER(ER_YES) : ER(ER_NO));
117
115
USER_RESOURCES ur;
118
116
thd->security_ctx->skip_grants();
119
117
memset(&ur, 0, sizeof(USER_RESOURCES));