]> git.saurik.com Git - apt.git/blobdiff - methods/ftp.cc
merged from lp:~donkult/apt/sid/
[apt.git] / methods / ftp.cc
index c91600ad5388f7cc675922ce731e37ad43faf59e..eb7fedd85509bca7e838670d829ebad976ed8f40 100644 (file)
@@ -19,6 +19,7 @@
 #include <apt-pkg/acquire-method.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/acquire-method.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/hashes.h>
+#include <apt-pkg/netrc.h>
 
 #include <sys/stat.h>
 #include <sys/time.h>
 
 #include <sys/stat.h>
 #include <sys/time.h>
@@ -68,7 +69,8 @@ time_t FtpMethod::FailTime = 0;
 // ---------------------------------------------------------------------
 /* */
 FTPConn::FTPConn(URI Srv) : Len(0), ServerFd(-1), DataFd(-1), 
 // ---------------------------------------------------------------------
 /* */
 FTPConn::FTPConn(URI Srv) : Len(0), ServerFd(-1), DataFd(-1), 
-                            DataListenFd(-1), ServerName(Srv)
+                            DataListenFd(-1), ServerName(Srv),
+                           ForceExtended(false), TryPassive(true)
 {
    Debug = _config->FindB("Debug::Acquire::Ftp",false);
    PasvAddr = 0;
 {
    Debug = _config->FindB("Debug::Acquire::Ftp",false);
    PasvAddr = 0;
@@ -558,7 +560,7 @@ bool FTPConn::ExtGoPasv()
    string::const_iterator List[4];
    unsigned Count = 0;
    Pos++;
    string::const_iterator List[4];
    unsigned Count = 0;
    Pos++;
-   for (string::const_iterator I = Msg.begin() + Pos; I < Msg.end(); I++)
+   for (string::const_iterator I = Msg.begin() + Pos; I < Msg.end(); ++I)
    {
       if (*I != Msg[Pos])
         continue;
    {
       if (*I != Msg[Pos])
         continue;
@@ -660,8 +662,7 @@ bool FTPConn::ModTime(const char *Path, time_t &Time)
       return true;
    
    // Parse it
       return true;
    
    // Parse it
-   StrToTime(Msg,Time);
-   return true;
+   return FTPMDTMStrToTime(Msg.c_str(), Time);
 }
                                                                        /*}}}*/
 // FTPConn::CreateDataFd - Get a data connection                       /*{{{*/
 }
                                                                        /*}}}*/
 // FTPConn::CreateDataFd - Get a data connection                       /*{{{*/
@@ -982,7 +983,9 @@ bool FtpMethod::Fetch(FetchItem *Itm)
    FetchResult Res;
    Res.Filename = Itm->DestFile;
    Res.IMSHit = false;
    FetchResult Res;
    Res.Filename = Itm->DestFile;
    Res.IMSHit = false;
-   
+
+   maybe_add_auth (Get, _config->FindFile("Dir::Etc::netrc"));
+
    // Connect to the server
    if (Server == 0 || Server->Comp(Get) == false)
    {
    // Connect to the server
    if (Server == 0 || Server->Comp(Get) == false)
    {