From ee5b22f6fe46ed87deb590c37599fd03064be129 Mon Sep 17 00:00:00 2001 From: Stuart Henderson Date: Wed, 26 Aug 2009 11:54:32 +0000 Subject: 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@ --- usr.bin/ftp/fetch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin') 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); } -- cgit v1.2.3