Allow hostnames that are IP addresses with a netmask even when

running with --skip-name-resolve. (Bug #8471)


sql/sql_acl.cc:
  Add '/' to list of characters that doesn't trigger a need for resolving the
  hostname, so that the IP mask syntax works with skip-name-resolve.
This commit is contained in:
unknown 2005-02-14 20:33:14 -08:00
parent 1b46843c10
commit ddcb947ff7
4 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,7 @@
GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255';
SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255';
Grants for mysqltest_1@127.0.0.1/255.255.255.255
GRANT USAGE ON *.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255'
GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255'
REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255';
DROP USER mysqltest_1@'127.0.0.1/255.255.255.255';

View File

@ -0,0 +1 @@
--skip-name-resolve

View File

@ -0,0 +1,5 @@
# Bug #8471: IP address with mask fail when skip-name-resolve is on
GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255';
SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255';
REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255';
DROP USER mysqltest_1@'127.0.0.1/255.255.255.255';

View File

@ -1339,7 +1339,7 @@ bool hostname_requires_resolving(const char *hostname)
return FALSE;
for (; (cur=*hostname); hostname++)
{
if ((cur != '%') && (cur != '_') && (cur != '.') &&
if ((cur != '%') && (cur != '_') && (cur != '.') && (cur != '/') &&
((cur < '0') || (cur > '9')))
return TRUE;
}