chiark / gitweb /
util: make is_localhost() check for 'localdomain' too, so that we can use it for...
[elogind.git] / src / shared / util.c
index 0db4bd90e89cb09137381ab56c99d5e2ff3e48ad..d6cea4d208371e6275648c7cbabba2c9d1c4c78e 100644 (file)
@@ -6868,11 +6868,13 @@ char *tempfn_random(const char *p) {
 bool is_localhost(const char *hostname) {
         assert(hostname);
 
-        /* This tries to identify local hostnames described in RFC6761
-         * plus the redhatism of .localdomain */
+        /* 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") ||
@@ -6929,4 +6931,4 @@ int is_symlink(const char *path) {
                 return 1;
 
         return 0;
-}
\ No newline at end of file
+}