summaryrefslogtreecommitdiff
path: root/methods/ftp.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 17:03:02 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 17:03:02 +0000
commit2391e7b57aa9656cedb4477455ae850f89857275 (patch)
tree6da46e8cf69ab6f32ad6850efb12a540521d5e43 /methods/ftp.cc
parent1cf23abce1b615aff8b0bf9f1c6ea43dd152ab9c (diff)
downloadapt-2391e7b57aa9656cedb4477455ae850f89857275.tar.gz
* Let the ftp method work with ftp servers which do not...
Author: mdz Date: 2003-08-10 02:24:39 GMT * Let the ftp method work with ftp servers which do not require a password (Closes: #199425)
Diffstat (limited to 'methods/ftp.cc')
-rw-r--r--methods/ftp.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/methods/ftp.cc b/methods/ftp.cc
index cc2f1395d..fb84f3f55 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: ftp.cc,v 1.30 2003/02/10 07:34:41 doogie Exp $
+// $Id: ftp.cc,v 1.31 2003/08/10 02:24:39 mdz Exp $
/* ######################################################################
FTP Aquire Method - This is the FTP aquire method for APT.
@@ -209,11 +209,13 @@ bool FTPConn::Login()
if (Tag >= 400)
return _error->Error(_("USER failed, server said: %s"),Msg.c_str());
- // Send the Password
- if (WriteMsg(Tag,Msg,"PASS %s",Pass.c_str()) == false)
- return false;
- if (Tag >= 400)
- return _error->Error(_("PASS failed, server said: %s"),Msg.c_str());
+ if (Tag == 331) { // 331 User name okay, need password.
+ // Send the Password
+ if (WriteMsg(Tag,Msg,"PASS %s",Pass.c_str()) == false)
+ return false;
+ if (Tag >= 400)
+ return _error->Error(_("PASS failed, server said: %s"),Msg.c_str());
+ }
// Enter passive mode
if (_config->Exists("Acquire::FTP::Passive::" + ServerName.Host) == true)