diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-07-27 22:37:52 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-08-05 20:49:21 -0400 |
commit | 90365b043ab6a0d8100e0c37dea4ca9d6fdb4695 (patch) | |
tree | b96bba6c42dbd17f6062fdb1c8d9b1a3378079cc /src/basic/hostname-util.c | |
parent | ae691c1d9382995ea7e28317f5c37023229c27ee (diff) | |
download | systemd-90365b043ab6a0d8100e0c37dea4ca9d6fdb4695.tar.gz |
hostname-util: ignore case when checking if hostname is localhost
Diffstat (limited to 'src/basic/hostname-util.c')
-rw-r--r-- | src/basic/hostname-util.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/basic/hostname-util.c b/src/basic/hostname-util.c index 95d9c3dd83..d901a5e82b 100644 --- a/src/basic/hostname-util.c +++ b/src/basic/hostname-util.c @@ -141,14 +141,14 @@ bool is_localhost(const char *hostname) { /* This tries to identify local host and domain names * described in RFC6761 plus the redhatism of .localdomain */ - return streq(hostname, "localhost") || - streq(hostname, "localhost.") || - streq(hostname, "localdomain.") || - streq(hostname, "localdomain") || - endswith(hostname, ".localhost") || - endswith(hostname, ".localhost.") || - endswith(hostname, ".localdomain") || - endswith(hostname, ".localdomain."); + return strcaseeq(hostname, "localhost") || + strcaseeq(hostname, "localhost.") || + strcaseeq(hostname, "localdomain.") || + strcaseeq(hostname, "localdomain") || + endswith_no_case(hostname, ".localhost") || + endswith_no_case(hostname, ".localhost.") || + endswith_no_case(hostname, ".localdomain") || + endswith_no_case(hostname, ".localdomain."); } int sethostname_idempotent(const char *s) { |