summaryrefslogtreecommitdiff
path: root/lib/libfetch/http.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2012-04-30 12:12:48 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2012-04-30 12:12:48 +0000
commitf51b84bcc47c2cdded3d08678bb58cc8d724b317 (patch)
tree003f6d8832f6b3250cff1e865714b8cc0bea5b1e /lib/libfetch/http.c
parent30787285b5cb3601820bdaf00fc7128195da03db (diff)
Notes
Diffstat (limited to 'lib/libfetch/http.c')
-rw-r--r--lib/libfetch/http.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index 557ff26ebf94..f6e063aa7121 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -1779,7 +1779,9 @@ http_request(struct url *URL, const char *op, struct url_stat *us,
DEBUG(fprintf(stderr, "failed to parse new URL\n"));
goto ouch;
}
- if (!*new->user && !*new->pwd) {
+
+ /* Only copy credentials if the host matches */
+ if (!strcmp(new->host, url->host) && !*new->user && !*new->pwd) {
strcpy(new->user, url->user);
strcpy(new->pwd, url->pwd);
}