summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2009-08-26 11:54:32 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2009-08-26 11:54:32 +0000
commitee5b22f6fe46ed87deb590c37599fd03064be129 (patch)
tree8a26adaf1e78500f8633cfc3b153f56deffef4e0 /usr.bin
parent2f9e6ddb7660479bdd6cecfd47e2e52f767ffee3 (diff)
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@
Diffstat (limited to 'usr.bin')
-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);
}