MCPcopy Create free account
hub / github.com/MariaDB/server / compare_hostname

Function compare_hostname

sql/sql_acl.cc:4702–4714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4700
4701
4702static bool compare_hostname(const acl_host_and_ip *host, const char *hostname,
4703 const char *ip)
4704{
4705 long tmp;
4706 if (host->ip_mask && ip && calc_ip(ip,&tmp,'\0'))
4707 {
4708 return (tmp & host->ip_mask) == host->ip;
4709 }
4710 return (!host->hostname ||
4711 (hostname && !wild_case_compare(system_charset_info,
4712 hostname, host->hostname)) ||
4713 (ip && !wild_compare(ip, host->hostname, 0)));
4714}
4715
4716/**
4717 Check if the given host name needs to be resolved or not.

Callers 10

wild_eqMethod · 0.85
matchesMethod · 0.85
find_by_username_or_anonFunction · 0.85
acl_getFunction · 0.85
acl_check_hostFunction · 0.85
find_user_wildFunction · 0.85
name_hash_searchFunction · 0.85
check_grant_db_routineFunction · 0.85
check_grant_dbFunction · 0.85
maria_compare_hostnameFunction · 0.85

Calls 3

calc_ipFunction · 0.85
wild_case_compareFunction · 0.85
wild_compareFunction · 0.85

Tested by

no test coverage detected