diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2000-12-27 16:40:21 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2000-12-27 16:40:21 +0000 |
| commit | 71049a55f1c596ef29020496c50a909ae32164f5 (patch) | |
| tree | 91a642736e50bb35f47bfdaa1920b4636ac3d2a0 /lib/libfetch | |
| parent | 8d1d6dfb1ad47ab9997a730f27efabdfc3f00e64 (diff) | |
Notes
Diffstat (limited to 'lib/libfetch')
| -rw-r--r-- | lib/libfetch/fetch.3 | 2 | ||||
| -rw-r--r-- | lib/libfetch/ftp.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/libfetch/fetch.3 b/lib/libfetch/fetch.3 index 9c21fcd9b60b..780bda700843 100644 --- a/lib/libfetch/fetch.3 +++ b/lib/libfetch/fetch.3 @@ -421,6 +421,8 @@ The accompanying error message includes a protocol-specific error code and message, e.g. "File is not available (404 Not Found)" .Sh ENVIRONMENT .Bl -tag -width FTP_PASSIVE_MODE +.It Ev FTP_LOGIN +Default FTP login if none was provided in the URL. .It Ev FTP_PASSIVE_MODE If set to anything but .Ql no , diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c index 59d71908d29e..da4f7ce03471 100644 --- a/lib/libfetch/ftp.c +++ b/lib/libfetch/ftp.c @@ -762,6 +762,8 @@ _ftp_connect(struct url *url, struct url *purl, char *flags) /* send user name and password */ user = url->user; if (!user || !*user) + user = getenv("FTP_LOGIN"); + if (!user || !*user) user = FTP_ANONYMOUS_USER; if (purl && url->port == _fetch_default_port(url->scheme)) e = _ftp_cmd(cd, "USER %s@%s", user, url->host); |
