MCPcopy Create free account
hub / github.com/Tencent/phxsql / login_failed_error

Function login_failed_error

phx_percona/percona/sql/sql_acl.cc:9797–9843  ·  view source on GitHub ↗

a helper function to report an access denied error in all the proper places */

Source from the content-addressed store, hash-verified

9795 a helper function to report an access denied error in all the proper places
9796*/
9797static void login_failed_error(MPVIO_EXT *mpvio, int passwd_used)
9798{
9799 THD *thd= current_thd;
9800 if (passwd_used == 2)
9801 {
9802 my_error(ER_ACCESS_DENIED_NO_PASSWORD_ERROR, MYF(0),
9803 mpvio->auth_info.user_name,
9804 mpvio->auth_info.host_or_ip);
9805 general_log_print(thd, COM_CONNECT, ER(ER_ACCESS_DENIED_NO_PASSWORD_ERROR),
9806 mpvio->auth_info.user_name,
9807 mpvio->auth_info.host_or_ip);
9808 /*
9809 Log access denied messages to the error log when log-warnings = 2
9810 so that the overhead of the general query log is not required to track
9811 failed connections.
9812 */
9813 if (log_warnings > 1)
9814 {
9815 sql_print_warning(ER(ER_ACCESS_DENIED_NO_PASSWORD_ERROR),
9816 mpvio->auth_info.user_name,
9817 mpvio->auth_info.host_or_ip);
9818 }
9819 }
9820 else
9821 {
9822 my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
9823 mpvio->auth_info.user_name,
9824 mpvio->auth_info.host_or_ip,
9825 passwd_used ? ER(ER_YES) : ER(ER_NO));
9826 general_log_print(thd, COM_CONNECT, ER(ER_ACCESS_DENIED_ERROR),
9827 mpvio->auth_info.user_name,
9828 mpvio->auth_info.host_or_ip,
9829 passwd_used ? ER(ER_YES) : ER(ER_NO));
9830 /*
9831 Log access denied messages to the error log when log-warnings = 2
9832 so that the overhead of the general query log is not required to track
9833 failed connections.
9834 */
9835 if (log_warnings > 1)
9836 {
9837 sql_print_warning(ER(ER_ACCESS_DENIED_ERROR),
9838 mpvio->auth_info.user_name,
9839 mpvio->auth_info.host_or_ip,
9840 passwd_used ? ER(ER_YES) : ER(ER_NO));
9841 }
9842 }
9843}
9844
9845/**
9846 sends a server handshake initialization packet, the very first packet

Callers 1

acl_authenticateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected