mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
Don't reuse credentials if redirected to a different host.
Submitted by: Niels Heinen <heinenn@google.com> MFC after: 3 weeks
This commit is contained in:
parent
30787285b5
commit
f51b84bcc4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=234838
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user