]> git.saurik.com Git - apt.git/commitdiff
add maybe_add_auth for ftp as well
authorMichael Vogt <michael.vogt@ubuntu.com>
Fri, 16 Oct 2009 13:42:05 +0000 (15:42 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Fri, 16 Oct 2009 13:42:05 +0000 (15:42 +0200)
methods/ftp.cc
methods/http.cc
methods/https.cc

index c91600ad5388f7cc675922ce731e37ad43faf59e..eb398666f322bccd6eca2dde1287299f5b304efa 100644 (file)
@@ -982,7 +982,9 @@ bool FtpMethod::Fetch(FetchItem *Itm)
    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)
    {
index 6bfe80baf0a4c1fe76f1331d4ae1595249420ee7..50478b44c846e8ffa6a16a8baff5180d84ffea10 100644 (file)
@@ -725,9 +725,9 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out)
       Req += string("Proxy-Authorization: Basic ") + 
           Base64Encode(Proxy.User + ":" + Proxy.Password) + "\r\n";
 
+   maybe_add_auth (Uri, _config->FindFile("Dir::Etc::netrc"));
    if (Uri.User.empty() == false || Uri.Password.empty() == false)
    {
-      maybe_add_auth (Uri, _config->FindFile("Dir::Etc::netrc"));
       Req += string("Authorization: Basic ") + 
           Base64Encode(Uri.User + ":" + Uri.Password) + "\r\n";
    }
index a86c78029b29e33cb75dcdbb68213d4878d34787..075d655b794355d98d8057e8727ee193cd10f103 100644 (file)
@@ -127,7 +127,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
    curl_easy_reset(curl);
    SetupProxy();
 
-   maybe_add_auth (Uri, _config->FindFile("Dir::ETc::netrc"));
+   maybe_add_auth (Uri, _config->FindFile("Dir::Etc::netrc"));
 
    // callbacks
    curl_easy_setopt(curl, CURLOPT_URL, Itm->Uri.c_str());