mirror of
https://github.com/systemd/systemd.git
synced 2025-03-25 18:50:18 +03:00
Merge pull request #2959 from keszybz/stop-resolving-localdomain
*.localdomain != localhost
This commit is contained in:
commit
77384fb0ed
@ -70,9 +70,10 @@
|
||||
is on the local loopback) and the IPv6 address ::1 (which is the
|
||||
local host).</para></listitem>
|
||||
|
||||
<listitem><para>The hostname <literal>localhost</literal> (as well as any hostname ending in
|
||||
<literal>.localhost</literal>, <literal>.localdomain</literal> or equal to <literal>localdomain</literal>) is
|
||||
resolved to the IP addresses 127.0.0.1 and ::1.</para></listitem>
|
||||
<listitem><para>The hostnames <literal>localhost</literal> and
|
||||
<literal>localhost.localdomain</literal> (as well as any hostname
|
||||
ending in <literal>.localhost</literal> or <literal>.localhost.localdomain</literal>)
|
||||
are resolved to the IP addresses 127.0.0.1 and ::1.</para></listitem>
|
||||
|
||||
<listitem><para>The hostname <literal>gateway</literal> is
|
||||
resolved to all current default routing gateway addresses,
|
||||
|
@ -87,9 +87,10 @@
|
||||
is on the local loopback) and the IPv6 address ::1 (which is the
|
||||
local host).</para></listitem>
|
||||
|
||||
<listitem><para>The hostname <literal>localhost</literal> (as well as any hostname ending in
|
||||
<literal>.localhost</literal>, <literal>.localdomain</literal> or equal to <literal>localdomain</literal>) is
|
||||
resolved to the IP addresses 127.0.0.1 and ::1.</para></listitem>
|
||||
<listitem><para>The hostnames <literal>localhost</literal> and
|
||||
<literal>localhost.localdomain</literal> (as well as any hostname
|
||||
ending in <literal>.localhost</literal> or <literal>.localhost.localdomain</literal>)
|
||||
are resolved to the IP addresses 127.0.0.1 and ::1.</para></listitem>
|
||||
|
||||
<listitem><para>The hostname <literal>gateway</literal> is
|
||||
resolved to all current default routing gateway addresses,
|
||||
|
@ -178,16 +178,16 @@ bool is_localhost(const char *hostname) {
|
||||
assert(hostname);
|
||||
|
||||
/* This tries to identify local host and domain names
|
||||
* described in RFC6761 plus the redhatism of .localdomain */
|
||||
* described in RFC6761 plus the redhatism of localdomain */
|
||||
|
||||
return strcaseeq(hostname, "localhost") ||
|
||||
strcaseeq(hostname, "localhost.") ||
|
||||
strcaseeq(hostname, "localdomain.") ||
|
||||
strcaseeq(hostname, "localdomain") ||
|
||||
strcaseeq(hostname, "localhost.localdomain") ||
|
||||
strcaseeq(hostname, "localhost.localdomain.") ||
|
||||
endswith_no_case(hostname, ".localhost") ||
|
||||
endswith_no_case(hostname, ".localhost.") ||
|
||||
endswith_no_case(hostname, ".localdomain") ||
|
||||
endswith_no_case(hostname, ".localdomain.");
|
||||
endswith_no_case(hostname, ".localhost.localdomain") ||
|
||||
endswith_no_case(hostname, ".localhost.localdomain.");
|
||||
}
|
||||
|
||||
bool is_gateway_hostname(const char *hostname) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user