1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug#35924 DEFINER should be stored 'quoted' in I_S

The '@' symbol can not be used in the host name according to rfc952.
The fix:
added function check_host_name(LEX_STRING *str)
which checks that all symbols in host name string are valid and
host name length is not more than max host name length
(just moved check_string_length() function from the parser into check_host_name()).
This commit is contained in:
Sergey Glukhov
2008-10-02 16:57:52 +05:00
parent d4876079b1
commit aa9f6a62a7
5 changed files with 41 additions and 2 deletions

View File

@ -7982,3 +7982,35 @@ int test_if_data_home_dir(const char *dir)
C_MODE_END
/**
Check that host name string is valid.
@param[in] str string to be checked
@return Operation status
@retval FALSE host name is ok
@retval TRUE host name string is longer than max_length or
has invalid symbols
*/
bool check_host_name(LEX_STRING *str)
{
const char *name= str->str;
const char *end= str->str + str->length;
if (check_string_length(str, ER(ER_HOSTNAME), HOSTNAME_LENGTH))
return TRUE;
while (name != end)
{
if (*name == '@')
{
my_printf_error(ER_UNKNOWN_ERROR,
"Malformed hostname (illegal symbol: '%c')", MYF(0),
*name);
return TRUE;
}
name++;
}
return FALSE;
}