Re: [PATCH] Only write the short hostname to the localhost line (#474086)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





David Cantrell wrote:
Do not write the FQDN to the localhost line, only write the short
hostname if it's something other than 'localhost'.  Only write the
FQDN line to /etc/hosts if we have an IP address for the host.

Without this patch, users performing media installs who enter an
FQDN in the hostname field end up with their FQDN == 127.0.0.1,
which messes up things, such as sendmail.  Writing the short name
is what we really want here.


Looks good.

Regards,

Hans

[rawhide]
---
 network.py |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/network.py b/network.py
index adde7cb..a2624cf 100644
--- a/network.py
+++ b/network.py
@@ -677,14 +677,9 @@ class Network:
                 domainname = None
localline = "localhost.localdomain localhost"
-            if not ip or not fqdn:
-                # There is no ip or no fqdn, tie it to 127.0.0.1.
-                if fqdn:
-                    # add fqdn to 127.0.0.1
-                    localline += " " + fqdn
-                if hostname and hostname != "localhost":
-                    # add short hostname to 127.0.0.1
-                    localline += " " + hostname
+            if not ip and (hostname and hostname != "localhost"):
+                # add short hostname to 127.0.0.1
+                localline += " " + hostname
f.write("# Do not remove the following line, or various programs\n")
             f.write("# that require network functionality will fail.\n")

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux