Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/usr.bin/ftp Pull up following revision(s) (requested by n...



details:   https://anonhg.NetBSD.org/src/rev/11cdbb3b8712
branches:  netbsd-6
changeset: 777175:11cdbb3b8712
user:      snj <snj%NetBSD.org@localhost>
date:      Thu Jul 06 15:27:18 2017 +0000

description:
Pull up following revision(s) (requested by nonaka in ticket #1428):
        usr.bin/ftp/fetch.c: revision 1.227
Use the first name we requested the http/https URL for, not any name we ended
up with after random redirects.

diffstat:

 usr.bin/ftp/fetch.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 6b8469e8a887 -r 11cdbb3b8712 usr.bin/ftp/fetch.c
--- a/usr.bin/ftp/fetch.c       Thu Jul 06 15:25:57 2017 +0000
+++ b/usr.bin/ftp/fetch.c       Thu Jul 06 15:27:18 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fetch.c,v 1.195.2.5 2017/07/06 15:22:41 snj Exp $      */
+/*     $NetBSD: fetch.c,v 1.195.2.6 2017/07/06 15:27:18 snj Exp $      */
 
 /*-
  * Copyright (c) 1997-2015 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.195.2.5 2017/07/06 15:22:41 snj Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.195.2.6 2017/07/06 15:27:18 snj Exp $");
 #endif /* not lint */
 
 /*
@@ -1369,6 +1369,12 @@
                        savefile = ftp_strdup(cp + 1);
                else
                        savefile = ftp_strdup(decodedpath);
+               /*
+                * Use the first URL we requested not the name after a
+                * possible redirect, but careful to save it because our
+                * "safety" check is the match to outfile.
+                */
+               outfile = ftp_strdup(savefile);
        }
        DPRINTF("%s: savefile `%s'\n", __func__, savefile);
        if (EMPTYSTRING(savefile)) {



Home | Main Index | Thread Index | Old Index