diff options
-rw-r--r-- | libmysqld/lib_sql.cc | 14 | ||||
-rw-r--r-- | sql/sql_acl.cc | 9 | ||||
-rw-r--r-- | sql/sql_cache.cc | 2 | ||||
-rw-r--r-- | sql/sql_parse.cc | 4 |
4 files changed, 14 insertions, 15 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 5b8df1d118d..1ef84607155 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -236,7 +236,7 @@ static bool check_user(THD *thd,enum_server_command command, const char *user, const char *passwd, const char *db, bool check_count) { NET *net= &thd->net; - uint max=0; + USER_RESOURCES ur; thd->db=0; if (!(thd->user = my_strdup(user, MYF(0)))) @@ -248,22 +248,22 @@ static bool check_user(THD *thd,enum_server_command command, const char *user, passwd, thd->scramble, &thd->priv_user, protocol_version == 9 || !(thd->client_capabilities & - CLIENT_LONG_PASSWORD),&max); - DBUG_PRINT("general", + CLIENT_LONG_PASSWORD),&ur); + DBUG_PRINT("info", ("Capabilities: %d packet_length: %d Host: '%s' User: '%s' Using password: %s Access: %u db: '%s'", thd->client_capabilities, thd->max_packet_length, - thd->host ? thd->host : thd->ip, thd->priv_user, + thd->host_or_ip, thd->priv_user, passwd[0] ? "yes": "no", thd->master_access, thd->db ? thd->db : "*none*")); if (thd->master_access & NO_ACCESS) { net_printf(net, ER_ACCESS_DENIED_ERROR, thd->user, - thd->host ? thd->host : thd->ip, + thd->host_or_ip, passwd[0] ? ER(ER_YES) : ER(ER_NO)); mysql_log.write(thd,COM_CONNECT,ER(ER_ACCESS_DENIED_ERROR), thd->user, - thd->host ? thd->host : thd->ip ? thd->ip : "unknown ip", + thd->host_or_ip, passwd[0] ? ER(ER_YES) : ER(ER_NO)); return(1); // Error already given } @@ -284,7 +284,7 @@ static bool check_user(THD *thd,enum_server_command command, const char *user, (char*) "%s@%s on %s" : (char*) "%s@%s as anonymous on %s"), user, - thd->host ? thd->host : thd->ip ? thd->ip : "unknown ip", + thd->host_or_ip, db ? db : (char*) ""); thd->db_access=0; if (db && db[0]) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 97cd02e5032..9c2eb9feb69 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1180,20 +1180,17 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, char *password,empty_string[1]; DBUG_ENTER("replace_user_table"); + password=empty_string; + empty_string[0]=0; if (combo.password.str && combo.password.str[0]) { - if (combo.password.length <= HASH_PASSWORD_LENGTH) + if (combo.password.length != HASH_PASSWORD_LENGTH) { send_error(&thd->net, ER_PASSWORD_NO_MATCH); DBUG_RETURN(1); } password=combo.password.str; } - else - { - password=empty_string; - empty_string[0]=0; - } table->field[0]->store(combo.host.str,combo.host.length); table->field[1]->store(combo.user.str,combo.user.length); diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 69b0f6bb3a5..87ca7003b7b 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1071,7 +1071,7 @@ void Query_cache::invalidate(CHANGED_TABLE_LIST *tables_used) DUMP(this); for ( ; tables_used; tables_used=tables_used->next) { - invalidate_table((uchar *) tables_used->key, tables_used->key_length); + invalidate_table((byte*) tables_used->key, tables_used->key_length); DBUG_PRINT("qcache", (" db %s, table %s", tables_used->key, tables_used->table_name)); } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index af68c1bb9f3..315c4b85a1c 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -242,7 +242,8 @@ static bool check_user(THD *thd,enum_server_command command, const char *user, db ? db : (char*) ""); thd->db_access=0; /* Don't allow user to connect if he has done too many queries */ - if ((ur.questions || ur.updates || ur.connections) && get_or_create_user_conn(thd,user,thd->host_or_ip,&ur)) + if ((ur.questions || ur.updates || ur.connections) && + get_or_create_user_conn(thd,user,thd->host_or_ip,&ur)) return -1; if (thd->user_connect && thd->user_connect->user_resources.connections && check_for_max_user_connections(thd->user_connect)) @@ -259,6 +260,7 @@ static bool check_user(THD *thd,enum_server_command command, const char *user, return 0; // ok } + /* Check for maximum allowable user connections, if the mysqld server is started with corresponding variable that is greater then 0. |