[PATCH] Actually use the ftp login&password parse code (#505424)

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

 



---
 loader2/urlinstall.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/loader2/urlinstall.c b/loader2/urlinstall.c
index 0e0df02..1c07224 100644
--- a/loader2/urlinstall.c
+++ b/loader2/urlinstall.c
@@ -340,6 +340,7 @@ int getFileFromUrl(char * url, char * dest,
     enum urlprotocol_t proto = 
         !strncmp(url, "ftp://";, 6) ? URL_METHOD_FTP : URL_METHOD_HTTP;
     char * host = NULL, * file = NULL, * chptr = NULL;
+    char * user = NULL, * password = NULL;
     int fd, rc;
     struct networkDeviceConfig netCfg;
     char * ehdrs = NULL;
@@ -355,8 +356,8 @@ int getFileFromUrl(char * url, char * dest,
 
     tip = &(netCfg.dev.ip);
     inet_ntop(tip->sa_family, IP_ADDR(tip), ret, IP_STRLEN(tip));
-    getHostandPath((proto == URL_METHOD_FTP ? url + 6 : url + 7), 
-                   &host, &file, ret);
+    getHostPathandLogin((proto == URL_METHOD_FTP ? url + 6 : url + 7), 
+                   &host, &file, &user, &password, ret);
 
     logMessage(INFO, "file location: %s://%s/%s", 
                (proto == URL_METHOD_FTP ? "ftp" : "http"), host, file);
@@ -373,6 +374,11 @@ int getFileFromUrl(char * url, char * dest,
         ui.prefix = strdup(host);
     }
 
+    if (user && strlen(user)){
+        ui.login = strdup(user);
+        if (password && strlen(password)) ui.password = strdup(password);
+    }
+
     if (proto == URL_METHOD_HTTP) {
         ehdrs = (char *) malloc(24+strlen(VERSION));
         sprintf(ehdrs, "User-Agent: anaconda/%s\r\n", VERSION);
-- 
1.6.4.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