summaryrefslogtreecommitdiff
path: root/usr.bin/ftp/fetch.c
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2009-06-04 20:58:35 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2009-06-04 20:58:35 +0000
commitf49b9c2cf8708fe1467a8a6bf651d57e7659864d (patch)
tree467017bc7299b6394b18918a4d30f13f25635fe3 /usr.bin/ftp/fetch.c
parentf1c1b6fef62287c387d034d57b537130bc3ffc8a (diff)
set anonftp a little later; in autofetcher itself. after we
actually know that that login is not provided in url; and we should guess it. fixes a bug reported by halex@ where it tried to login as 'ftp' after unsuccessful logins; ok theo, halex@, krw@
Diffstat (limited to 'usr.bin/ftp/fetch.c')
-rw-r--r--usr.bin/ftp/fetch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index 9af36730408..be548efe7b1 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fetch.c,v 1.87 2009/05/10 21:45:52 martynas Exp $ */
+/* $OpenBSD: fetch.c,v 1.88 2009/06/04 20:58:34 martynas Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
@@ -1009,7 +1009,9 @@ bad_ftp_url:
xargc = 3;
}
oautologin = autologin;
- if (username != NULL)
+ if (username == NULL)
+ anonftp = 1; /* Handle "automatic" transfers. */
+ else
autologin = 0;
setpeer(xargc, xargv);
autologin = oautologin;