Commit 61820bca authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: sql_acl.cc

* remove no-op check_password_policy() and references to it
* add 'static' to functions that need it
* remove unused function check_acl_user()
parent f5722f58
...@@ -2184,7 +2184,6 @@ String *Item_func_password::val_str_ascii(String *str) ...@@ -2184,7 +2184,6 @@ String *Item_func_password::val_str_ascii(String *str)
String *res= args[0]->val_str(str); String *res= args[0]->val_str(str);
switch (alg){ switch (alg){
case NEW: case NEW:
check_password_policy(res);
if (args[0]->null_value || res->length() == 0) if (args[0]->null_value || res->length() == 0)
return make_empty_result(); return make_empty_result();
my_make_scrambled_password(tmp_value, res->ptr(), res->length()); my_make_scrambled_password(tmp_value, res->ptr(), res->length());
...@@ -2215,13 +2214,8 @@ char *Item_func_password::alloc(THD *thd, const char *password, ...@@ -2215,13 +2214,8 @@ char *Item_func_password::alloc(THD *thd, const char *password,
switch (al) { switch (al) {
case NEW: case NEW:
{
String *password_str= new (thd->mem_root)String(password, thd->variables.
character_set_client);
check_password_policy(password_str);
my_make_scrambled_password(buff, password, pass_len); my_make_scrambled_password(buff, password, pass_len);
break; break;
}
case OLD: case OLD:
my_make_scrambled_password_323(buff, password, pass_len); my_make_scrambled_password_323(buff, password, pass_len);
break; break;
......
...@@ -2406,7 +2406,7 @@ static void init_check_host(void) ...@@ -2406,7 +2406,7 @@ static void init_check_host(void)
'acl_user' array, which are invalidated by drop operation, and use 'acl_user' array, which are invalidated by drop operation, and use
ACL_USER::host::hostname as a key, which is changed by rename. ACL_USER::host::hostname as a key, which is changed by rename.
*/ */
void rebuild_check_host(void) static void rebuild_check_host(void)
{ {
delete_dynamic(&acl_wild_hosts); delete_dynamic(&acl_wild_hosts);
my_hash_free(&acl_check_hosts); my_hash_free(&acl_check_hosts);
...@@ -2594,7 +2594,7 @@ bool acl_check_host(const char *host, const char *ip) ...@@ -2594,7 +2594,7 @@ bool acl_check_host(const char *host, const char *ip)
@retval 1 Error @retval 1 Error
*/ */
int check_alter_user(THD *thd, const char *host, const char *user) static int check_alter_user(THD *thd, const char *host, const char *user)
{ {
int error = 1; int error = 1;
if (!initialized) if (!initialized)
...@@ -5596,7 +5596,7 @@ static bool merge_one_role_privileges(ACL_ROLE *grantee) ...@@ -5596,7 +5596,7 @@ static bool merge_one_role_privileges(ACL_ROLE *grantee)
End of the role privilege propagation and graph traversal code End of the role privilege propagation and graph traversal code
******************************************************************/ ******************************************************************/
bool copy_and_check_auth(LEX_USER *to, LEX_USER *from, LEX *lex) static bool copy_and_check_auth(LEX_USER *to, LEX_USER *from, LEX *lex)
{ {
if (to != from) if (to != from)
{ {
...@@ -6646,7 +6646,8 @@ end_index_init: ...@@ -6646,7 +6646,8 @@ end_index_init:
} }
my_bool role_propagate_grants_action(void *ptr, void *unused __attribute__((unused))) static my_bool role_propagate_grants_action(void *ptr,
void *unused __attribute__((unused)))
{ {
ACL_ROLE *role= (ACL_ROLE *)ptr; ACL_ROLE *role= (ACL_ROLE *)ptr;
if (role->counter) if (role->counter)
...@@ -8426,26 +8427,6 @@ static int open_grant_tables(THD *thd, TABLE_LIST *tables, ...@@ -8426,26 +8427,6 @@ static int open_grant_tables(THD *thd, TABLE_LIST *tables,
DBUG_RETURN(0); DBUG_RETURN(0);
} }
ACL_USER *check_acl_user(LEX_USER *user_name, uint *acl_acl_userdx)
{
ACL_USER *acl_user= 0;
uint counter;
mysql_mutex_assert_owner(&acl_cache->lock);
for (counter= 0 ; counter < acl_users.elements ; counter++)
{
acl_user= dynamic_element(&acl_users, counter, ACL_USER*);
if(acl_user->eq(user_name->user.str, user_name->host.str))
break;
}
if (counter == acl_users.elements)
return 0;
*acl_acl_userdx= counter;
return acl_user;
}
/* /*
Modify a privilege table. Modify a privilege table.
...@@ -12629,9 +12610,3 @@ maria_declare_plugin(mysql_password) ...@@ -12629,9 +12610,3 @@ maria_declare_plugin(mysql_password)
} }
maria_declare_plugin_end; maria_declare_plugin_end;
/* called when new user is created or exsisting password is changed */
int check_password_policy(String *password)
{
return (0);
}
...@@ -266,7 +266,6 @@ int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond); ...@@ -266,7 +266,6 @@ int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond);
int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond); int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond);
int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond); int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond);
int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *wildstr); int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *wildstr);
int check_password_policy(String *password);
/** /**
Result of an access check for an internal schema or table. Result of an access check for an internal schema or table.
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "sql_table.h" // build_table_filename, #include "sql_table.h" // build_table_filename,
// check_n_cut_mysql50_prefix // check_n_cut_mysql50_prefix
#include "sql_db.h" // get_default_db_collation #include "sql_db.h" // get_default_db_collation
#include "sql_acl.h" // *_ACL, is_acl_user #include "sql_acl.h" // *_ACL
#include "sql_handler.h" // mysql_ha_rm_tables #include "sql_handler.h" // mysql_ha_rm_tables
#include "sp_cache.h" // sp_invalidate_cache #include "sp_cache.h" // sp_invalidate_cache
#include <mysys_err.h> #include <mysys_err.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment