1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.0

into  zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.1
This commit is contained in:
cmiller@zippy.cornsilk.net
2006-08-17 12:17:52 -04:00
16 changed files with 424 additions and 134 deletions

View File

@ -4838,6 +4838,32 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables)
DBUG_RETURN(0);
}
ACL_USER *check_acl_user(LEX_USER *user_name,
uint *acl_acl_userdx)
{
ACL_USER *acl_user= 0;
uint counter;
safe_mutex_assert_owner(&acl_cache->lock);
for (counter= 0 ; counter < acl_users.elements ; counter++)
{
const char *user,*host;
acl_user= dynamic_element(&acl_users, counter, ACL_USER*);
if (!(user=acl_user->user))
user= "";
if (!(host=acl_user->host.hostname))
host= "";
if (!strcmp(user_name->user.str,user) &&
!my_strcasecmp(system_charset_info, user_name->host.str, host))
break;
}
if (counter == acl_users.elements)
return 0;
*acl_acl_userdx= counter;
return acl_user;
}
/*
Modify a privilege table.
@ -4886,7 +4912,6 @@ static int modify_grant_table(TABLE *table, Field *host_field,
DBUG_RETURN(error);
}
/*
Handle a privilege table.
@ -5382,7 +5407,16 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
{
result= TRUE;
continue;
}
}
if (user_name->host.length > HOSTNAME_LENGTH ||
user_name->user.length > USERNAME_LENGTH)
{
append_user(&wrong_users, user_name);
result= TRUE;
continue;
}
/*
Search all in-memory structures and grant tables
for a mention of the new user name.
@ -5523,7 +5557,7 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list)
result= TRUE;
}
}
/* Rebuild 'acl_check_hosts' since 'acl_users' has been modified */
rebuild_check_host();