aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2016-03-02 14:51:22 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2016-03-02 14:51:22 +0000
commit0d3f794e1b3ff5fad5e58a91722c3143b77642d6 (patch)
tree1cc68eea36bb41ada982d80dba9348b1a83455d4
parentfaf4814606d432aaa129677e45c357193b960ab9 (diff)
downloadsrc-0d3f794e1b3ff5fad5e58a91722c3143b77642d6.tar.gz
src-0d3f794e1b3ff5fad5e58a91722c3143b77642d6.zip
Import tnftp-20150912vendor/tnftp
Notes
Notes: svn path=/vendor/tnftp/dist/; revision=296314
-rw-r--r--ChangeLog10
-rw-r--r--NEWS12
-rwxr-xr-xconfigure34
-rw-r--r--configure.ac16
-rw-r--r--src/fetch.c13
-rw-r--r--src/ftp.115
-rw-r--r--src/ftp_var.h6
-rw-r--r--src/main.c21
-rw-r--r--src/ssl.c14
-rw-r--r--src/ssl.h6
-rw-r--r--src/version.h8
11 files changed, 97 insertions, 58 deletions
diff --git a/ChangeLog b/ChangeLog
index 3705df3e23a1..0c4c8f13eb72 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
-$NetBSD: ChangeLog,v 1.66 2014/11/03 21:48:49 lukem Exp $
+$NetBSD: ChangeLog,v 1.67 2015/10/04 06:20:58 lukem Exp $
+Sun Oct 4 06:19:25 UTC 2015 lukem
+
+ * Release as "tnftp 20151004".
+
+ * Merge NetBSD usr.bin/ftp from 20141026 to 20151003:
+ - Add -x xferbufsize to set xferbuf size.
+ - Add Server Name Indication (SNI) support for https.
+ - Increase buffer limit used for response handling.
Mon Nov 3 21:43:20 UTC 2014 lukem
diff --git a/NEWS b/NEWS
index b08000689eb7..f9a16d6f9959 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,14 @@
-$NetBSD: NEWS,v 1.11 2014/11/03 21:48:49 lukem Exp $
+$NetBSD: NEWS,v 1.12 2015/10/04 06:20:58 lukem Exp $
-This is tnftp version 20141104.
+This is tnftp version 20151004.
+
+Changes in tnftp 20141104 to 20151004:
+
+ Implement '-x xferbufsize' to set xferbuf size.
+
+ Add Server Name Indication (SNI) support for https.
+
+ Increase buffer limit used for response handling.
Changes in tnftp from 20141031 to 20141104:
diff --git a/configure b/configure
index f518841d6aa2..89731d7d2233 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#! /bin/sh
-# From configure.ac Revision: 1.29 .
+# From configure.ac Revision: 1.31 .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for tnftp 20141104.
+# Generated by GNU Autoconf 2.69 for tnftp 20151004.
#
# Report bugs to <lukem@NetBSD.org>.
#
@@ -13,7 +13,7 @@
# gives unlimited permission to copy, distribute and modify it.
#
#
-# Copyright (c) 1999-2014 The NetBSD Foundation, Inc.
+# Copyright (c) 1999-2015 The NetBSD Foundation, Inc.
# All rights reserved.
#
## -------------------- ##
@@ -596,8 +596,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='tnftp'
PACKAGE_TARNAME='tnftp'
-PACKAGE_VERSION='20141104'
-PACKAGE_STRING='tnftp 20141104'
+PACKAGE_VERSION='20151004'
+PACKAGE_STRING='tnftp 20151004'
PACKAGE_BUGREPORT='lukem@NetBSD.org'
PACKAGE_URL=''
@@ -1333,7 +1333,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures tnftp 20141104 to adapt to many kinds of systems.
+\`configure' configures tnftp 20151004 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1403,7 +1403,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of tnftp 20141104:";;
+ short | recursive ) echo "Configuration of tnftp 20151004:";;
esac
cat <<\_ACEOF
@@ -1518,7 +1518,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-tnftp configure 20141104
+tnftp configure 20151004
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1526,7 +1526,7 @@ This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
-Copyright (c) 1999-2014 The NetBSD Foundation, Inc.
+Copyright (c) 1999-2015 The NetBSD Foundation, Inc.
All rights reserved.
_ACEOF
@@ -2103,7 +2103,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by tnftp $as_me 20141104, which was
+It was created by tnftp $as_me 20151004, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3067,7 +3067,7 @@ fi
# Define the identity of the package.
PACKAGE='tnftp'
- VERSION='20141104'
+ VERSION='20151004'
cat >>confdefs.h <<_ACEOF
@@ -3150,9 +3150,9 @@ fi
# Check whether --enable-ssl was given.
if test "${enable_ssl+set}" = set; then :
- enableval=$enable_ssl; opt_ssl=$enableval
+ enableval=$enable_ssl; with_ssl=$enableval
else
- opt_ssl=auto
+ with_ssl=auto
fi
@@ -12109,7 +12109,7 @@ else
if test "$with_socks" != "auto"; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "--with-socks was given, but SOCKSinit() wasn't found
+as_fn_error $? "--with-socks was given, but SOCKSinit() was not found
See \`config.log' for more details" "$LINENO" 5; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: disabling --with-socks" >&5
@@ -12287,7 +12287,7 @@ else
if test "$with_ssl" != "auto"; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "--with-ssl was given, but OpenSSL wasn't found
+as_fn_error $? "--with-ssl was given, but OpenSSL was not found
See \`config.log' for more details" "$LINENO" 5; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: disabling --with-ssl" >&5
@@ -15275,7 +15275,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by tnftp $as_me 20141104, which was
+This file was extended by tnftp $as_me 20151004, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -15341,7 +15341,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-tnftp config.status 20141104
+tnftp config.status 20151004
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index c06533bd801e..275475047391 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,15 +1,15 @@
-# $NetBSD: configure.ac,v 1.29 2014/11/03 21:48:49 lukem Exp $
+# $NetBSD: configure.ac,v 1.31 2015/10/04 05:16:25 lukem Exp $
#
# Process this file with autoconf to produce a configure script.
-AC_INIT([tnftp], [20141104], [lukem@NetBSD.org])
+AC_INIT([tnftp], [20151004], [lukem@NetBSD.org])
AC_PREREQ([2.69])
AC_COPYRIGHT([
-Copyright (c) 1999-2014 The NetBSD Foundation, Inc.
+Copyright (c) 1999-2015 The NetBSD Foundation, Inc.
All rights reserved.
])
-AC_REVISION([$Revision: 1.29 $])
+AC_REVISION([$Revision: 1.31 $])
AS_SHELL_SANITIZE()
@@ -41,8 +41,8 @@ AC_ARG_ENABLE([ssl],
[AS_HELP_STRING([--enable-ssl],
[enable SSL support (requires --with-openssl)
[default=auto]])],
- [opt_ssl=$enableval],
- [opt_ssl=auto])
+ [with_ssl=$enableval],
+ [with_ssl=auto])
AC_ARG_WITH([socks],
[AS_HELP_STRING([--with-socks],
[enable support for (Dante) SOCKS5 proxy
@@ -129,7 +129,7 @@ AS_IF([test "$with_socks" != no],
opt_ipv6=no])],
[AS_IF([test "$with_socks" != "auto"],
[AC_MSG_FAILURE(
- [--with-socks was given, but SOCKSinit() wasn't found])])
+ [--with-socks was given, but SOCKSinit() was not found])])
AC_MSG_NOTICE([disabling --with-socks])
with_socks=no])])
@@ -145,7 +145,7 @@ AS_IF([test "$with_ssl" != no],
AC_MSG_NOTICE([enabling SSL support])
with_ssl=yes],
[AS_IF([test "$with_ssl" != "auto"],
- [AC_MSG_FAILURE([--with-ssl was given, but OpenSSL wasn't found])])
+ [AC_MSG_FAILURE([--with-ssl was given, but OpenSSL was not found])])
AC_MSG_NOTICE([disabling --with-ssl])
with_ssl=no])])
diff --git a/src/fetch.c b/src/fetch.c
index 6981f77fff86..d0f40d3f99f3 100644
--- a/src/fetch.c
+++ b/src/fetch.c
@@ -1,8 +1,8 @@
-/* $NetBSD: fetch.c,v 1.20 2014/10/31 03:37:59 lukem Exp $ */
-/* from NetBSD: fetch.c,v 1.206 2014/10/26 16:21:59 christos Exp */
+/* $NetBSD: fetch.c,v 1.21 2015/10/04 04:53:26 lukem Exp $ */
+/* from NetBSD: fetch.c,v 1.207 2015/09/12 19:38:42 wiz Exp */
/*-
- * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997-2015 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -11,6 +11,9 @@
* This code is derived from software contributed to The NetBSD Foundation
* by Scott Aaron Bamford.
*
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Thomas Klausner.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -39,7 +42,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID(" NetBSD: fetch.c,v 1.206 2014/10/26 16:21:59 christos Exp ");
+__RCSID(" NetBSD: fetch.c,v 1.207 2015/09/12 19:38:42 wiz Exp ");
#endif /* not lint */
/*
@@ -789,7 +792,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
#ifdef WITH_SSL
if (urltype == HTTPS_URL_T) {
- if ((ssl = fetch_start_ssl(s)) == NULL) {
+ if ((ssl = fetch_start_ssl(s, host)) == NULL) {
close(s);
s = -1;
continue;
diff --git a/src/ftp.1 b/src/ftp.1
index f6a3516d8b39..3180f005ca5f 100644
--- a/src/ftp.1
+++ b/src/ftp.1
@@ -1,7 +1,7 @@
-.\" $NetBSD: ftp.1,v 1.14 2013/05/05 11:17:30 lukem Exp $
-.\" from NetBSD: ftp.1,v 1.134 2012/12/22 16:57:10 christos Exp
+.\" $NetBSD: ftp.1,v 1.15 2015/10/04 04:53:26 lukem Exp $
+.\" from NetBSD: ftp.1,v 1.135 2015/04/23 23:31:23 lukem Exp
.\"
-.\" Copyright (c) 1996-2010 The NetBSD Foundation, Inc.
+.\" Copyright (c) 1996-2015 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
@@ -58,7 +58,7 @@
.\"
.\" @(#)ftp.1 8.3 (Berkeley) 10/9/94
.\"
-.Dd December 22, 2012
+.Dd April 24, 2015
.Dt FTP 1
.Os
.Sh NAME
@@ -85,6 +85,7 @@
.Xc
.Oc
.Ek
+.Op Fl x Ar xferbufsize
.Bk -words
.\" [[user@]host [port]]
.Oo
@@ -312,6 +313,12 @@ Forces
.Nm
to show all responses from the remote server, as well
as report on data transfer statistics.
+.It Fl x Ar xferbufsize
+Set the size of the socket send and receive buffers to
+.Ar xferbufsize .
+Refer to
+.Ic xferbuf
+for more information.
.El
.Pp
The client host with which
diff --git a/src/ftp_var.h b/src/ftp_var.h
index 79ac75decc61..50f9c9a25b69 100644
--- a/src/ftp_var.h
+++ b/src/ftp_var.h
@@ -1,5 +1,5 @@
-/* $NetBSD: ftp_var.h,v 1.11 2013/05/05 11:17:31 lukem Exp $ */
-/* from NetBSD: ftp_var.h,v 1.82 2012/12/21 18:07:36 christos Exp */
+/* $NetBSD: ftp_var.h,v 1.12 2015/10/04 04:53:26 lukem Exp $ */
+/* from NetBSD: ftp_var.h,v 1.83 2015/01/12 14:17:08 christos Exp */
/*-
* Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@@ -174,7 +174,7 @@ enum {
/*
* Global defines
*/
-#define FTPBUFLEN MAXPATHLEN + 200
+#define FTPBUFLEN (4 * MAXPATHLEN)
#define MAX_IN_PORT_T 0xffffU
#define HASHBYTES 1024 /* default mark for `hash' command */
diff --git a/src/main.c b/src/main.c
index 73390671ff37..8237d4dfb483 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,8 +1,8 @@
-/* $NetBSD: main.c,v 1.19 2013/05/05 11:48:16 lukem Exp $ */
-/* from NetBSD: main.c,v 1.122 2012/12/22 16:57:10 christos Exp */
+/* $NetBSD: main.c,v 1.20 2015/10/04 04:53:26 lukem Exp $ */
+/* from NetBSD: main.c,v 1.123 2015/04/23 23:31:23 lukem Exp */
/*-
- * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2015 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -96,14 +96,14 @@
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\
The Regents of the University of California. All rights reserved.\
- Copyright 1996-2008 The NetBSD Foundation, Inc. All rights reserved");
+ Copyright 1996-2015 The NetBSD Foundation, Inc. All rights reserved");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
#else
-__RCSID(" NetBSD: main.c,v 1.122 2012/12/22 16:57:10 christos Exp ");
+__RCSID(" NetBSD: main.c,v 1.123 2015/04/23 23:31:23 lukem Exp ");
#endif
#endif /* not lint */
@@ -275,7 +275,7 @@ main(int volatile argc, char **volatile argv)
}
}
- while ((ch = getopt(argc, argv, "46AadefginN:o:pP:q:r:Rs:tT:u:vV")) != -1) {
+ while ((ch = getopt(argc, argv, "46AadefginN:o:pP:q:r:Rs:tT:u:vVx:")) != -1) {
switch (ch) {
case '4':
family = AF_INET;
@@ -417,6 +417,13 @@ main(int volatile argc, char **volatile argv)
progress = verbose = 0;
break;
+ case 'x':
+ sndbuf_size = strsuftoi(optarg);
+ if (sndbuf_size < 1)
+ errx(1, "Bad xferbuf value: %s", optarg);
+ rcvbuf_size = sndbuf_size;
+ break;
+
default:
usage();
}
@@ -1054,7 +1061,7 @@ usage(void)
(void)fprintf(stderr,
"usage: %s [-46AadefginpRtVv] [-N netrc] [-o outfile] [-P port] [-q quittime]\n"
-" [-r retry] [-s srcaddr] [-T dir,max[,inc]]\n"
+" [-r retry] [-s srcaddr] [-T dir,max[,inc]] [-x xferbufsize]\n"
" [[user@]host [port]] [host:path[/]] [file:///file]\n"
" [ftp://[user[:pass]@]host[:port]/path[/]]\n"
" [http://[user[:pass]@]host[:port]/path] [...]\n"
diff --git a/src/ssl.c b/src/ssl.c
index 173db08ebbd2..8587526b9dca 100644
--- a/src/ssl.c
+++ b/src/ssl.c
@@ -1,9 +1,10 @@
-/* $NetBSD: ssl.c,v 1.2 2013/05/05 13:17:06 lukem Exp $ */
-/* from NetBSD: ssl.c,v 1.2 2012/12/24 22:12:28 christos Exp */
+/* $NetBSD: ssl.c,v 1.3 2015/10/04 04:53:26 lukem Exp $ */
+/* from NetBSD: ssl.c,v 1.5 2015/09/16 15:32:53 joerg Exp */
/*-
* Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
* Copyright (c) 2008, 2010 Joerg Sonnenberger <joerg@NetBSD.org>
+ * Copyright (c) 2015 Thomas Klausner <wiz@NetBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -38,7 +39,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID(" NetBSD: ssl.c,v 1.2 2012/12/24 22:12:28 christos Exp ");
+__RCSID(" NetBSD: ssl.c,v 1.5 2015/09/16 15:32:53 joerg Exp ");
#endif
#include <time.h>
@@ -552,7 +553,7 @@ fetch_getline(struct fetch_connect *conn, char *buf, size_t buflen,
}
void *
-fetch_start_ssl(int sock)
+fetch_start_ssl(int sock, const char *servername)
{
SSL *ssl;
SSL_CTX *ctx;
@@ -576,6 +577,11 @@ fetch_start_ssl(int sock)
return NULL;
}
SSL_set_fd(ssl, sock);
+ if (!SSL_set_tlsext_host_name(ssl, __UNCONST(servername))) {
+ fprintf(ttyout, "SSL hostname setting failed\n");
+ SSL_CTX_free(ctx);
+ return NULL;
+ }
while ((ret = SSL_connect(ssl)) == -1) {
ssl_err = SSL_get_error(ssl, ret);
if (ssl_err != SSL_ERROR_WANT_READ &&
diff --git a/src/ssl.h b/src/ssl.h
index 217fcdf512c1..56be916e07b6 100644
--- a/src/ssl.h
+++ b/src/ssl.h
@@ -1,5 +1,5 @@
-/* $NetBSD: ssl.h,v 1.2 2014/10/31 03:57:14 lukem Exp $ */
-/* from NetBSD: ssl.h,v 1.2 2014/01/07 02:07:08 joerg Exp */
+/* $NetBSD: ssl.h,v 1.3 2015/10/04 04:53:26 lukem Exp $ */
+/* from NetBSD: ssl.h,v 1.3 2015/09/12 19:38:42 wiz Exp */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@ ssize_t fetch_read(void *, size_t, size_t, struct fetch_connect *);
char *fetch_getln(char *, int, struct fetch_connect *);
int fetch_getline(struct fetch_connect *, char *, size_t, const char **);
void fetch_set_ssl(struct fetch_connect *, void *);
-void *fetch_start_ssl(int);
+void *fetch_start_ssl(int, const char *);
#else /* !WITH_SSL */
diff --git a/src/version.h b/src/version.h
index f5ad9721c387..80c54553bf23 100644
--- a/src/version.h
+++ b/src/version.h
@@ -1,8 +1,8 @@
-/* $NetBSD: version.h,v 1.6 2014/10/31 03:37:59 lukem Exp $ */
-/* from NetBSD: version.h,v 1.85 2014/10/31 03:27:18 lukem Exp */
+/* $NetBSD: version.h,v 1.7 2015/10/04 04:53:26 lukem Exp $ */
+/* from NetBSD: version.h,v 1.87 2015/09/12 20:18:52 wiz Exp */
/*-
- * Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999-2015 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -35,5 +35,5 @@
#endif
#ifndef FTP_VERSION
-#define FTP_VERSION "20141026"
+#define FTP_VERSION "20150912"
#endif