changeset 370:f514f510ebaa

2003-1-18 Brian Masney <masneyb@gftp.org> * lib/rfc959.c (rfc959_connect) - if the username is anonymous and a password is already supplied, don't clobber it.
author masneyb
date Sun, 18 Jan 2004 20:39:40 +0000
parents c63208a1f0f1
children 39b57989c34a
files ChangeLog lib/rfc959.c
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Jan 18 20:30:08 2004 +0000
+++ b/ChangeLog	Sun Jan 18 20:39:40 2004 +0000
@@ -1,4 +1,7 @@
 2003-1-18 Brian Masney <masneyb@gftp.org>
+	* lib/rfc959.c (rfc959_connect) - if the username is anonymous and a
+	password is already supplied, don't clobber it.
+
 	* lib/misc.c (gftp_build_path) - when checking for already existing
 	/'s, not only look at the end of the currently built string, but look
 	at the beginning of the token that is about to be added
@@ -2019,7 +2022,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.203 2004/01/18 20:30:08 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.204 2004/01/18 20:39:39 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/lib/rfc959.c	Sun Jan 18 20:30:08 2004 +0000
+++ b/lib/rfc959.c	Sun Jan 18 20:39:40 2004 +0000
@@ -451,17 +451,18 @@
 
   parms = request->protocol_data;
 
-  gftp_lookup_request_option (request, "email", &email);
   gftp_lookup_request_option (request, "ftp_proxy_host", &proxy_hostname);
   gftp_lookup_request_option (request, "ftp_proxy_port", &proxy_port);
 
   if (request->username == NULL || *request->username == '\0')
+    gftp_set_username (request, "anonymous");
+
+  if (strcasecmp (request->username, "anonymous") == 0 &&
+      (request->password == NULL || *request->password == '\0'))
     {
-      gftp_set_username (request, "anonymous");
+      gftp_lookup_request_option (request, "email", &email);
       gftp_set_password (request, email);
     }
-  else if (strcasecmp (request->username, "anonymous") == 0)
-    gftp_set_password (request, email);
    
   if ((ret = gftp_connect_server (request, "ftp", proxy_hostname, proxy_port)) < 0)
     return (ret);