Module Name:    othersrc
Committed By:   lukem
Date:           Sun Oct  4 04:53:26 UTC 2015

Modified Files:
        othersrc/usr.bin/tnftp/src: fetch.c ftp.1 ftp_var.h main.c ssl.c ssl.h
            version.h

Log Message:
Merge NetBSD-20151003 import


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 othersrc/usr.bin/tnftp/src/fetch.c
cvs rdiff -u -r1.14 -r1.15 othersrc/usr.bin/tnftp/src/ftp.1
cvs rdiff -u -r1.11 -r1.12 othersrc/usr.bin/tnftp/src/ftp_var.h
cvs rdiff -u -r1.19 -r1.20 othersrc/usr.bin/tnftp/src/main.c
cvs rdiff -u -r1.2 -r1.3 othersrc/usr.bin/tnftp/src/ssl.c \
    othersrc/usr.bin/tnftp/src/ssl.h
cvs rdiff -u -r1.6 -r1.7 othersrc/usr.bin/tnftp/src/version.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/usr.bin/tnftp/src/fetch.c
diff -u othersrc/usr.bin/tnftp/src/fetch.c:1.20 othersrc/usr.bin/tnftp/src/fetch.c:1.21
--- othersrc/usr.bin/tnftp/src/fetch.c:1.20	Fri Oct 31 03:37:59 2014
+++ othersrc/usr.bin/tnftp/src/fetch.c	Sun Oct  4 04:53:26 2015
@@ -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 *p
 
 #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;

Index: othersrc/usr.bin/tnftp/src/ftp.1
diff -u othersrc/usr.bin/tnftp/src/ftp.1:1.14 othersrc/usr.bin/tnftp/src/ftp.1:1.15
--- othersrc/usr.bin/tnftp/src/ftp.1:1.14	Sun May  5 11:17:30 2013
+++ othersrc/usr.bin/tnftp/src/ftp.1	Sun Oct  4 04:53:26 2015
@@ -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

Index: othersrc/usr.bin/tnftp/src/ftp_var.h
diff -u othersrc/usr.bin/tnftp/src/ftp_var.h:1.11 othersrc/usr.bin/tnftp/src/ftp_var.h:1.12
--- othersrc/usr.bin/tnftp/src/ftp_var.h:1.11	Sun May  5 11:17:31 2013
+++ othersrc/usr.bin/tnftp/src/ftp_var.h	Sun Oct  4 04:53:26 2015
@@ -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 */

Index: othersrc/usr.bin/tnftp/src/main.c
diff -u othersrc/usr.bin/tnftp/src/main.c:1.19 othersrc/usr.bin/tnftp/src/main.c:1.20
--- othersrc/usr.bin/tnftp/src/main.c:1.19	Sun May  5 11:48:16 2013
+++ othersrc/usr.bin/tnftp/src/main.c	Sun Oct  4 04:53:26 2015
@@ -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 
 		}
 	}
 
-	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 
 			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"

Index: othersrc/usr.bin/tnftp/src/ssl.c
diff -u othersrc/usr.bin/tnftp/src/ssl.c:1.2 othersrc/usr.bin/tnftp/src/ssl.c:1.3
--- othersrc/usr.bin/tnftp/src/ssl.c:1.2	Sun May  5 13:17:06 2013
+++ othersrc/usr.bin/tnftp/src/ssl.c	Sun Oct  4 04:53:26 2015
@@ -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 <[email protected]>
+ * Copyright (c) 2015 Thomas Klausner <[email protected]>
  * 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
 }
 
 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 &&
Index: othersrc/usr.bin/tnftp/src/ssl.h
diff -u othersrc/usr.bin/tnftp/src/ssl.h:1.2 othersrc/usr.bin/tnftp/src/ssl.h:1.3
--- othersrc/usr.bin/tnftp/src/ssl.h:1.2	Fri Oct 31 03:57:14 2014
+++ othersrc/usr.bin/tnftp/src/ssl.h	Sun Oct  4 04:53:26 2015
@@ -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_
 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 */
 

Index: othersrc/usr.bin/tnftp/src/version.h
diff -u othersrc/usr.bin/tnftp/src/version.h:1.6 othersrc/usr.bin/tnftp/src/version.h:1.7
--- othersrc/usr.bin/tnftp/src/version.h:1.6	Fri Oct 31 03:37:59 2014
+++ othersrc/usr.bin/tnftp/src/version.h	Sun Oct  4 04:53:26 2015
@@ -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

Reply via email to