[master&rhel6-branch 6/8] Do parse DOMAIN for DNS search suffixes in loader (#595388)

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

 



This is very handy on s390, where it's sometimes hard to write more than
80 chars for repo/stage2/updates etc.

Also write out quoted since it is a whitespace separated list.
---
 loader/loader.c |    2 ++
 loader/loader.h |    2 +-
 loader/net.c    |    7 ++++++-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/loader/loader.c b/loader/loader.c
index 10ac12b..381f19b 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -739,6 +739,8 @@ static void readNetInfo(struct loaderData_s ** ld) {
                     loaderData->gateway = strdup(val);
                 } else if (!g_strcmp0(pair[0], "DNS")) {
                     loaderData->dns = strdup(val);
+                } else if (!g_strcmp0(pair[0], "DOMAIN")) {
+                    loaderData->domain = strdup(val);
                 } else if (!g_strcmp0(pair[0], "MTU")) {
                     errno = 0;
                     loaderData->mtu = strtol(val, NULL, 10);
diff --git a/loader/loader.h b/loader/loader.h
index 0b910f7..f35e3ff 100644
--- a/loader/loader.h
+++ b/loader/loader.h
@@ -132,7 +132,7 @@ struct loaderData_s {
     int bootIf_set;
     char * netCls;
     int netCls_set;
-    char *ipv4, *netmask, *gateway, *dns, *hostname, *peerid, *ethtool, *subchannels, *portname, *essid, *wepkey, *nettype, *ctcprot, *options, *macaddr;
+    char *ipv4, *netmask, *gateway, *dns, *domain, *hostname, *peerid, *ethtool, *subchannels, *portname, *essid, *wepkey, *nettype, *ctcprot, *options, *macaddr;
 #ifdef ENABLE_IPV6
     char *ipv6;
     int ipv6info_set;
diff --git a/loader/net.c b/loader/net.c
index 153e6f9..8e37a66 100644
--- a/loader/net.c
+++ b/loader/net.c
@@ -366,6 +366,11 @@ void setupIfaceStruct(iface_t * iface, struct loaderData_s * loaderData) {
         logMessage(INFO, "dnsservers is %s", loaderData->dns);
     }
 
+    if (loaderData->domain) {
+        logMessage(INFO, "dnsdomains is %s", loaderData->domain);
+        iface->domain = strdup(loaderData->domain);
+    }
+
     if (loaderData->hostname) {
         logMessage(INFO, "setting specified hostname of %s",
                    loaderData->hostname);
@@ -1397,7 +1402,7 @@ int writeEnabledNetInfo(iface_t *iface) {
     }
 
     if (iface->domain) {
-        fprintf(fp, "DOMAIN=%s\n", iface->domain);
+        fprintf(fp, "DOMAIN=\"%s\"\n", iface->domain);
     }
 
     if (iface->mtu) {
-- 
1.7.0.4


_______________________________________________
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