mirror of
https://github.com/mirror/wget.git
synced 2025-01-27 21:00:31 +08:00
Fix previous commit 2427ca4ac0
This commit is contained in:
parent
2427ca4ac0
commit
1a01a6b2d0
@ -370,6 +370,7 @@ getftp (struct url *u, struct url *original_url,
|
||||
user = opt.user;
|
||||
else
|
||||
user = NULL;
|
||||
|
||||
/* Find the password with priority */
|
||||
if (u->passwd)
|
||||
passwd = u->passwd;
|
||||
@ -381,9 +382,11 @@ getftp (struct url *u, struct url *original_url,
|
||||
passwd = opt.passwd;
|
||||
else
|
||||
passwd = NULL;
|
||||
|
||||
/* Check for ~/.netrc if none of the above match */
|
||||
if (opt.netrc && (!user || !passwd))
|
||||
search_netrc (u->host, (const char **)&user, (const char **)&passwd, 1);
|
||||
search_netrc (u->host, (const char **) &user, (const char **) &passwd, 1);
|
||||
|
||||
if (!user) user = "anonymous";
|
||||
if (!passwd) passwd = "-wget@";
|
||||
|
||||
|
@ -1886,6 +1886,7 @@ initialize_request (const struct url *u, struct http_stat *hs, int *dt, struct u
|
||||
*user = opt.user;
|
||||
else
|
||||
*user = NULL;
|
||||
|
||||
/* Find the password with priority */
|
||||
if (u->passwd)
|
||||
*passwd = u->passwd;
|
||||
@ -1897,9 +1898,10 @@ initialize_request (const struct url *u, struct http_stat *hs, int *dt, struct u
|
||||
*passwd = opt.passwd;
|
||||
else
|
||||
*passwd = NULL;
|
||||
|
||||
/* Check for ~/.netrc if none of the above match */
|
||||
if (opt.netrc && (!(*user) || !(*password)))
|
||||
search_netrc (u->host, (const char **)user, (const char **)passwd, 0);
|
||||
if (opt.netrc && (!user || !passwd))
|
||||
search_netrc (u->host, (const char **) user, (const char **) passwd, 0);
|
||||
|
||||
/* We only do "site-wide" authentication with "global" user/password
|
||||
* values unless --auth-no-challange has been requested; URL user/password
|
||||
|
Loading…
Reference in New Issue
Block a user