summaryrefslogtreecommitdiff
path: root/lib/libalpm/dload.c
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-09-11 15:11:24 -0400
committerDan McGee <dan@archlinux.org>2011-09-11 19:07:25 -0500
commitbefddfc3e6a1f61b0bb2b6c377f3a394a7620b81 (patch)
treebf5959cae74bde02132f11f1f97d80b0f2c17164 /lib/libalpm/dload.c
parentc736a12e86b826f3079f3cccde86d497528f85f3 (diff)
downloadpacman-befddfc3e6a1f61b0bb2b6c377f3a394a7620b81.tar.xz
dload: provide optional netrc support
if ~/.netrc exists and has credentials for the hostname requested in a download, they will be provided in an http auth request. This can still be overridden by explcitly declaring user:pass in the URL. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/dload.c')
-rw-r--r--lib/libalpm/dload.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index 4937f6ea..5ae02fc6 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -209,6 +209,7 @@ static void curl_set_handle_opts(struct dload_payload *payload,
curl_easy_setopt(handle->curl, CURLOPT_LOW_SPEED_TIME, 10L);
curl_easy_setopt(handle->curl, CURLOPT_HEADERFUNCTION, parse_headers);
curl_easy_setopt(handle->curl, CURLOPT_WRITEHEADER, (void *)payload);
+ curl_easy_setopt(handle->curl, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
_alpm_log(handle, ALPM_LOG_DEBUG, "url: %s\n", payload->fileurl);