diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2009-12-07 11:04:17 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2009-12-07 11:04:17 +0100 |
commit | 777b4ac6882b40f63f1aa9b6f4da78b8fdc56cbe (patch) | |
tree | 3cb631b8c36aef5f0892a92d4ed54efdbdfccd01 /methods/https.cc | |
parent | 5085e660679cdbb51783702898c42000d5db4fba (diff) | |
parent | 278835da0bbab11f57a9938d4193b66067c6eff1 (diff) |
merge lp:~mvo/apt/netrc branch, this adds support for a
/etc/apt/auth.conf that can be used to store username/passwords
in a "netrc" style file (with the extension that it supports "/"
in a machine definition). Based on the maemo git branch.
Diffstat (limited to 'methods/https.cc')
-rw-r--r-- | methods/https.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/methods/https.cc b/methods/https.cc index dbc1cf52c..86d7f3a6b 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -14,6 +14,7 @@ #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> @@ -126,8 +127,10 @@ bool HttpsMethod::Fetch(FetchItem *Itm) curl_easy_reset(curl); SetupProxy(); + maybe_add_auth (Uri, _config->FindFile("Dir::Etc::netrc")); + // callbacks - curl_easy_setopt(curl, CURLOPT_URL, Itm->Uri.c_str()); + curl_easy_setopt(curl, CURLOPT_URL, static_cast<string>(Uri).c_str()); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, this); curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback); |