rpms/ftp/devel netkit-ftp-0.17-multihome.patch, NONE, 1.1 ftp.spec, 1.23, 1.24

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Jan 12 10:40:04 UTC 2006


Author: praszyk

Update of /cvs/dist/rpms/ftp/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv12689

Modified Files:
	ftp.spec 
Added Files:
	netkit-ftp-0.17-multihome.patch 
Log Message:
Support for multi-homed clients, see  #171621


netkit-ftp-0.17-multihome.patch:
 ftp.1     |    4 ++++
 ftp.c     |   16 ++++++++++++++--
 ftp_var.h |    1 +
 main.c    |    6 ++++++
 4 files changed, 25 insertions(+), 2 deletions(-)

--- NEW FILE netkit-ftp-0.17-multihome.patch ---
--- netkit-ftp-0.17/ftp/ftp_var.h.rasold	2006-01-12 11:23:16.000000000 +0100
+++ netkit-ftp-0.17/ftp/ftp_var.h	2006-01-12 11:24:06.000000000 +0100
@@ -69,6 +69,7 @@
 Extern int	bell;		/* ring bell on cmd completion */
 Extern int	doglob;		/* glob local file names */
 Extern int	autologin;	/* establish user account on connection */
+Extern int	multihome;	/* multi homed host, use same interface for cmd and data channels */
 Extern int	proxy;		/* proxy server connection active */
 Extern int	proxflag;	/* proxy connection exists */
 Extern int	sunique;	/* store files on server with unique name */
--- netkit-ftp-0.17/ftp/ftp.c.rasold	2006-01-12 11:14:55.000000000 +0100
+++ netkit-ftp-0.17/ftp/ftp.c	2006-01-12 11:22:42.000000000 +0100
@@ -132,6 +132,7 @@
 static sigjmp_buf ptabort;
 static int ptabflg = 0;
 static int abrtflag = 0;
+struct sockaddr_in source;
 
 void lostpeer(int);
 extern int connected;
@@ -153,7 +154,7 @@
 char *
 hookup(const char *host, const char *port)
 {
-	int s, tos, error;
+	int s, tos, error, alen;
 	socklen_t len;
 	static char hostnamebuf[256];
 	struct addrinfo hints, *res, *res0;
@@ -278,7 +279,11 @@
 	}
 	if (verbose)
 		printf("Connected to %s (%s).\n", hostname, hbuf);
-	if (getreply(0) > 2) { 	/* read startup message from server */
+	alen = sizeof(source);
+	getsockname(s,(struct sockaddr*)&source, &alen);
+	source.sin_port = 0;    /* We just want the addr, not the port */
+
+	if (getreply(0) > 2) { 	/* read startup message from server    */
 		if (cin)
 			(void) fclose(cin);
 		if (cout)
@@ -1254,6 +1259,13 @@
 			perror("ftp: socket");
 			return(1);
 		}
+		if((multihome) &&
+			bind(data, (struct sockaddr*)&source, sizeof(source)) == -1) {
+			close(data);
+			data = -1;
+			perror("ftp multihome bind");
+			return(1);
+                }
 		if (options & SO_DEBUG &&
 		    setsockopt(data, SOL_SOCKET, SO_DEBUG, (char *)&on,
 			       sizeof (on)) < 0)
--- netkit-ftp-0.17/ftp/main.c.rasold	2006-01-12 11:24:27.000000000 +0100
+++ netkit-ftp-0.17/ftp/main.c	2006-01-12 11:27:20.000000000 +0100
@@ -93,6 +93,7 @@
 	printf("\t   -n: inhibit auto-login\n");
 	printf("\t   -e: disable readline support, if present\n");
 	printf("\t   -g: disable filename globbing\n");
+	printf("\t   -m: don't force data channel interface to the same as control channel\n");
 	printf("\t   -v: verbose mode\n");
 	printf("\t   -t: enable packet tracing [nonfunctional]\n");
 	printf("\t   -d: enable debugging\n");
@@ -120,6 +121,7 @@
 	doglob = 1;
 	interactive = 1;
 	autologin = 1;
+	multihome = 1;
 	passivemode = 1;
 
         cp = strrchr(argv[0], '/');
@@ -172,6 +174,10 @@
 				rl_inhibit = 1;
 				break;
 				
+			case 'm':
+				multihome = 0;
+				break;
+
 			case 'h':
 				usage();
 				exit(0);
--- netkit-ftp-0.17/ftp/ftp.1.rasold	2006-01-12 11:14:09.000000000 +0100
+++ netkit-ftp-0.17/ftp/ftp.1	2006-01-12 11:15:48.000000000 +0100
@@ -92,6 +92,10 @@
 executable. Otherwise, does nothing.
 .It Fl g
 Disables file name globbing.
+.It Fl m
+The default requires that ftp explicitly binds to the same interface for the data
+channel as the control channel in passive mode. Useful on multi-homed
+clients. This option disables this behavior.
 .It Fl v
 Verbose option forces
 .Nm ftp


Index: ftp.spec
===================================================================
RCS file: /cvs/dist/rpms/ftp/devel/ftp.spec,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ftp.spec	9 Dec 2005 22:40:30 -0000	1.23
+++ ftp.spec	12 Jan 2006 10:39:59 -0000	1.24
@@ -1,7 +1,7 @@
 Summary: The standard UNIX FTP (File Transfer Protocol) client.
 Name: ftp
 Version: 0.17
-Release: 31.1
+Release: 32.1
 License: BSD
 Group: Applications/Internet
 Source0: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit-devel/netkit-ftp-%{version}.tar.bz2
@@ -17,6 +17,7 @@
 Patch10: netkit-ftp-0.17-vsftp165083.patch
 Patch11: netkit-ftp-0.17-C-Frame121.patch
 Patch12: netkit-ftp-0.17-data.patch
+Patch13: netkit-ftp-0.17-multihome.patch
 BuildRoot: /var/tmp/%{name}-root
 BuildRequires: gcc, glibc-devel, readline-devel, ncurses-devel, perl
 
@@ -42,6 +43,7 @@
 %patch10 -p1 -b .vsftp165083
 %patch11 -p1 -b .C-Frame121
 %patch12 -p1 -b .data
+%patch13 -p1 -b .multihome
 
 %build
 sh configure --with-c-compiler=gcc --enable-ipv6
@@ -75,6 +77,10 @@
 %{_mandir}/man5/netrc.*
 
 %changelog
+* Thu Jan 12 2006 Petr Raszyk <praszyk at redhat.com> - 0.17-32
+- support for multi-homed clients
+  See #171621, netkit-ftp-0.17-multihome.patch
+
 * Fri Dec 09 2005 Jesse Keating <jkeating at redhat.com>
 - rebuilt
 




More information about the fedora-cvs-commits mailing list