summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormartynas <martynas@openbsd.org>2009-05-10 21:45:52 +0000
committermartynas <martynas@openbsd.org>2009-05-10 21:45:52 +0000
commit5de4d32b642ad38a65e573ab1a2ffe7d51df9ca0 (patch)
tree75238829b2b4e70c0b8fc902d334cd12a34c97af
parentConsistency. (diff)
downloadwireguard-openbsd-5de4d32b642ad38a65e573ab1a2ffe7d51df9ca0.tar.xz
wireguard-openbsd-5de4d32b642ad38a65e573ab1a2ffe7d51df9ca0.zip
couple of fixes for fetch:
- don't spam ftp server with four anonftp logins; if ftp_login has already failed in setpeer we give up. also makes install script nicer; req'd by theo - fix autologin = no case which never really worked in fetch since it did not check for autologin before logging in... part 1: ok theo, krw@ part 2: "looks right" millert@, ok sthen@
-rw-r--r--usr.bin/ftp/fetch.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index 947589b7be6..9af36730408 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fetch.c,v 1.86 2009/05/05 19:35:30 martynas Exp $ */
+/* $OpenBSD: fetch.c,v 1.87 2009/05/10 21:45:52 martynas Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
@@ -1013,8 +1013,9 @@ bad_ftp_url:
autologin = 0;
setpeer(xargc, xargv);
autologin = oautologin;
- if ((connected == 0) ||
- ((connected == 1) && !ftp_login(host, username, pass))) {
+ if (connected == 0 ||
+ (connected == 1 && autologin && (username == NULL ||
+ !ftp_login(host, username, pass)))) {
warnx("Can't connect or login to host `%s'", host);
rval = argpos + 1;
continue;