summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsthen <sthen@openbsd.org>2009-08-26 11:54:31 +0000
committersthen <sthen@openbsd.org>2009-08-26 11:54:31 +0000
commit647deafc3497bc0ea28c67a101a0c221355a51fb (patch)
tree5d224f9bef5b0a48b81d326f157e532b9528063b
parentsync (diff)
downloadwireguard-openbsd-647deafc3497bc0ea28c67a101a0c221355a51fb.tar.xz
wireguard-openbsd-647deafc3497bc0ea28c67a101a0c221355a51fb.zip
In "auto-fetch" mode without -o, the filename to save under is derived
from the URL. In cases where the URL supplied on the command-line returned an HTTP redirection, ftp(1) was changing the filename to one derived from the redirected URL. Change this to always use a name derived from the command-line URL. Avoids unexpected behaviour with URI-encoded redirection URLs as seen by matecocido on misc@, and avoids surprises when the redirection is to an unexpected filename. No change when -o is used. ok martynas@ deraadt@ "I totally approve" halex@
-rw-r--r--usr.bin/ftp/fetch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index 6c4a2a268ac..4420a2a0e9d 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fetch.c,v 1.95 2009/08/06 23:33:35 martynas Exp $ */
+/* $OpenBSD: fetch.c,v 1.96 2009/08/26 11:54:31 sthen Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
@@ -732,7 +732,7 @@ again:
free(proxyurl);
free(newline);
free(cookie);
- rval = url_get(cp, proxyenv, outfile);
+ rval = url_get(cp, proxyenv, savefile);
free(buf);
return (rval);
}