Re: [PATCH] Fix telnet install support (#471082)

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

 





David Cantrell wrote:
Someone tried it in F-10 and reported that it didn't work.  The
startTelnetd() function in telnetd.c needed some changes.

[rawhide]
---
 loader/telnetd.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)


Looks good to me.

Regards,

Hans

diff --git a/loader/telnetd.c b/loader/telnetd.c
index 99c6feb..17935bf 100644
--- a/loader/telnetd.c
+++ b/loader/telnetd.c
@@ -230,7 +230,7 @@ int beTelnet(void) {
 }
void startTelnetd(struct loaderData_s * loaderData) {
-    char ret[INET_ADDRSTRLEN+1];
+    char *ipaddr = NULL;
     iface_t iface;
iface_init_iface_t(&iface);
@@ -240,12 +240,16 @@ void startTelnetd(struct loaderData_s * loaderData) {
         return;
     }
- if (iface.ipaddr.s_addr) {
-        inet_ntop(AF_INET, &iface.ipaddr, ret, INET_ADDRSTRLEN);
-        logMessage(INFO, "going to beTelnet for %s", ret);
-        if (!beTelnet())
-            flags |= LOADER_FLAGS_TEXT | LOADER_FLAGS_NOSHELL;
+    ipaddr = iface_ip2str(iface.device, AF_INET);
+    if (ipaddr == NULL) {
+        logMessage(ERROR, "%s (%d): no IP address found for %s",
+                   __func__, __LINE__, iface.device);
+        return;
     }
+ logMessage(INFO, "going to beTelnet for %s", ipaddr);
+    if (!beTelnet())
+        flags |= LOADER_FLAGS_TEXT | LOADER_FLAGS_NOSHELL;
+
     return;
 }

_______________________________________________
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