From 90365b043ab6a0d8100e0c37dea4ca9d6fdb4695 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Mon, 27 Jul 2015 22:37:52 -0400 Subject: hostname-util: ignore case when checking if hostname is localhost --- src/basic/hostname-util.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/basic/hostname-util.c') 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) { -- cgit v1.2.3-54-g00ecf