duplicity ftp backup / ncftp no longer working since 8.0-Release

Manfred Usselmann usselmann.m at icg-online.de
Fri Jan 1 17:09:14 UTC 2010


On Fri, 1 Jan 2010 10:12:41 -0500
David Horn <dhorn2000 at gmail.com> wrote:

> On Fri, Jan 1, 2010 at 9:28 AM, Manfred Usselmann
> <usselmann.m at icg-online.de> wrote:
> > On Mon, 14 Dec 2009 17:51:31 -0500
> > David Horn <dhorn2000 at gmail.com> wrote:
> >
> >> On Mon, Dec 14, 2009 at 5:31 PM, Manfred Usselmann
> >> <usselmann.m at icg-online.de> wrote:
> >> > On Mon, 14 Dec 2009 08:17:16 +0100
> >> > Manfred Usselmann <usselmann.m at icg-online.de> wrote:
> >> >
> >> >> On Mon, 14 Dec 2009 00:23:17 -0500
> >> >> David Horn <dhorn2000 at gmail.com> wrote:
> >> >>
> >> >> > I believe that there is something unusual going on with the checking
> >> >> > on select() return in ncftp3.  If you change every instance of
> >> >> > select() result checking in ftp/ncftp3 from "==1" to ">=1" the problem
> >> >> > seems to go away.
> >> >> >
> >> >> > result = select(sfd + 1, NULL, SELECT_TYPE_ARG234 &ss, NULL,
> >> >> > SELECT_TYPE_ARG5 &tv);
> >> >> > -if (result == 1) {
> >> >> > +if (result >= 1) {
> >> >>
> >> >> I will try this.
> >> >
> >> > Did work for me!
> >> >
> >> > Thanks,
> >> > Manfred
> >>
> >> OK.   I will try to report it to the upstream (ncftp.com/contact), and
> >> failing that we could always patch as part of the ncftp 3.2.3 update
> >> into freebsd ports, but glad to hear it worked for you.
> >
> > The port has been updated to 3.2.3 but without a fix.
> >
> > http://www.freebsd.org/cgi/query-pr.cgi?pr=140934 mentions a fix to
> > FreeBSD 8 which sounds like it should have solved our issue. Don't know
> > why it didn't.
> >
> > Regards,
> > Manfred
> >
> 
> 3.2.3 of ncftp was released by the vendor in July 2009
> (http://www.ncftp.org/), so it would not have yet incorporated the
> select() result checking changes.
> 
> I reported the issue to ncftp, and they acknowledged the issue.  I can
> only assume that it will be addressed in the next vendor release
> (3.2.4 ?)  The obrien change was a patch to the freebsd  ncftp port
> (3.2.2) for the same issue, but only on one of the select() instances
> (not all of them).
> 
> http://www.freebsd.org/cgi/cvsweb.cgi/ports/ftp/ncftp3/files/Attic/patch-SConnect.c
> 
> The obrien commit was since reverted for 3.2.3 since the vendor
> included the one instance of select() result checking in the base
> code.
> 
> So, long story short, you still need to manually patch the source of
> ncftp until either
> 
> A)  Vendor updates base code (or)
> B)  Someone submits a patch to the freebsd port of ftp/ncftp3 (3.2.3)
> 
> If you are really concerned about it, create an official patch (use
> diff -u) and attach it to your bug report.  Bug reports with patches
> are much more likely to see action.
> 
> If you are having issues creating a patch let me know and I will try
> to find the time to do this in the next week or so. (ENOTIME)

Thanks a lot for the detailed explanation!

Since the vendor acknowledged the issue I'm fine with waiting until the
next version to see if an official fix is included.

Nevertheless I have created the attached patch. 

Thanks,
Manfred



-- 
Manfred Usselmann <usselmann.m at icg-online.de>
ICG IT Consulting GmbH, Kelkheim
-------------- next part --------------
diff -ur ncftp-3.2.3/autoconf_local/aclocal.m4 ncftp-3.2.3.fixed/autoconf_local/aclocal.m4
--- ncftp-3.2.3/autoconf_local/aclocal.m4	2009-07-28 16:45:58.000000000 +0200
+++ ncftp-3.2.3.fixed/autoconf_local/aclocal.m4	2009-12-14 14:00:45.000000000 +0100
@@ -4326,7 +4326,7 @@
 		for (;;) {
 			ss = ss2;
 			nready = select(fd + 1, &ss, NULL, NULL, &tleft);
-			if (nready == 1)
+			if (nready >= 1)
 				break;
 			if (nready < 0) {
 				if (errno != EINTR) {
diff -ur ncftp-3.2.3/configure ncftp-3.2.3.fixed/configure
--- ncftp-3.2.3/configure	2009-07-28 17:01:30.000000000 +0200
+++ ncftp-3.2.3.fixed/configure	2009-12-14 14:01:58.000000000 +0100
@@ -10010,7 +10010,7 @@
 		for (;;) {
 			ss = ss2;
 			nready = select(fd + 1, &ss, NULL, NULL, &tleft);
-			if (nready == 1)
+			if (nready >= 1)
 				break;
 			if (nready < 0) {
 				if (errno != EINTR) {
diff -ur ncftp-3.2.3/libncftp/io_util.c ncftp-3.2.3.fixed/libncftp/io_util.c
--- ncftp-3.2.3/libncftp/io_util.c	2005-01-01 22:30:04.000000000 +0100
+++ ncftp-3.2.3.fixed/libncftp/io_util.c	2009-12-14 14:07:48.000000000 +0100
@@ -192,7 +192,7 @@
 		tv.tv_sec = 1;
 		tv.tv_usec = 0;
 		result = select(fd + 1, SELECT_TYPE_ARG234 &ss, NULL, SELECT_TYPE_ARG234 &ss2, &tv);
-		if (result == 1) {
+		if (result >= 1) {
 			/* ready */
 			cip->stalled = 0;
 			return (1);
@@ -271,7 +271,7 @@
 		tv.tv_sec = 1;
 		tv.tv_usec = 0;
 		result = select(fd + 1, NULL, SELECT_TYPE_ARG234 &ss, SELECT_TYPE_ARG234 &ss2, &tv);
-		if (result == 1) {
+		if (result >= 1) {
 			/* ready */
 			cip->stalled = 0;
 			return (1);
diff -ur ncftp-3.2.3/libncftp/ncftp.h ncftp-3.2.3.fixed/libncftp/ncftp.h
--- ncftp-3.2.3/libncftp/ncftp.h	2009-07-23 22:20:53.000000000 +0200
+++ ncftp-3.2.3.fixed/libncftp/ncftp.h	2009-12-14 14:19:31.000000000 +0100
@@ -772,9 +772,9 @@
 
 /* The following block may be changed by configure script */
 #ifndef Stat
-#define Stat stat    /* set by configure at 2009-07-23 15:20:53 */
-#define Lstat lstat    /* set by configure at 2009-07-23 15:20:53 */
-#define Fstat fstat    /* set by configure at 2009-07-23 15:20:53 */
+#define Stat stat
+#define Lstat lstat
+#define Fstat fstat
 #endif
 
 #define kFtwNoAutoGrowButContinue (-1)
diff -ur ncftp-3.2.3/ncftp/gl_getline.c ncftp-3.2.3.fixed/ncftp/gl_getline.c
--- ncftp-3.2.3/ncftp/gl_getline.c	2008-07-14 04:35:48.000000000 +0200
+++ ncftp-3.2.3.fixed/ncftp/gl_getline.c	2009-12-14 14:09:19.000000000 +0100
@@ -440,7 +440,7 @@
 		tv.tv_sec = (tv_sec_t) (tlen / 10);
 		tv.tv_usec = (tv_usec_t) ((tlen % 10) * 100000);
 		result = select(1, &ss, NULL, NULL, &tv);
-		if (result == 1) {
+		if (result >= 1) {
 			/* ready */
 			break;
 		} else if (result == 0) {
diff -ur ncftp-3.2.3/sio/SAccept.c ncftp-3.2.3.fixed/sio/SAccept.c
--- ncftp-3.2.3/sio/SAccept.c	2003-09-01 04:14:45.000000000 +0200
+++ ncftp-3.2.3.fixed/sio/SAccept.c	2009-12-14 14:09:59.000000000 +0100
@@ -45,7 +45,7 @@
 		tv.tv_sec = (tv_sec_t) tlen;
 		tv.tv_usec = 0;
 		result = select(sfd + 1, SELECT_TYPE_ARG234 &ss, NULL, NULL, SELECT_TYPE_ARG5 &tv);
-		if (result == 1) {
+		if (result >= 1) {
 			/* ready */
 			break;
 		} else if (result == 0) {
diff -ur ncftp-3.2.3/sio/SRead.c ncftp-3.2.3.fixed/sio/SRead.c
--- ncftp-3.2.3/sio/SRead.c	2005-01-01 22:25:39.000000000 +0100
+++ ncftp-3.2.3.fixed/sio/SRead.c	2009-12-14 14:11:21.000000000 +0100
@@ -74,7 +74,7 @@
 				tv.tv_sec = (tv_sec_t) tleft;
 				tv.tv_usec = 0;
 				result = select(sfd + 1, SELECT_TYPE_ARG234 &ss, NULL, NULL, SELECT_TYPE_ARG5 &tv);
-				if (result == 1) {
+				if (result >= 1) {
 					/* ready */
 					break;
 				} else if (result == 0) {
diff -ur ncftp-3.2.3/sio/SRecv.c ncftp-3.2.3.fixed/sio/SRecv.c
--- ncftp-3.2.3/sio/SRecv.c	2003-09-01 05:55:36.000000000 +0200
+++ ncftp-3.2.3.fixed/sio/SRecv.c	2009-12-14 14:11:58.000000000 +0100
@@ -56,7 +56,7 @@
 				tv.tv_sec = (tv_sec_t) tleft;
 				tv.tv_usec = 0;
 				result = select(sfd + 1, SELECT_TYPE_ARG234 &ss, NULL, NULL, SELECT_TYPE_ARG5 &tv);
-				if (result == 1) {
+				if (result >= 1) {
 					/* ready */
 					break;
 				} else if (result == 0) {
diff -ur ncftp-3.2.3/sio/SRecvfrom.c ncftp-3.2.3.fixed/sio/SRecvfrom.c
--- ncftp-3.2.3/sio/SRecvfrom.c	2003-09-01 04:20:24.000000000 +0200
+++ ncftp-3.2.3.fixed/sio/SRecvfrom.c	2009-12-14 14:12:47.000000000 +0100
@@ -41,7 +41,7 @@
 			tv.tv_sec = (tv_sec_t) tleft;
 			tv.tv_usec = 0;
 			result = select(sfd + 1, SELECT_TYPE_ARG234 &ss, NULL, NULL, SELECT_TYPE_ARG5 &tv);
-			if (result == 1) {
+			if (result >= 1) {
 				/* ready */
 				break;
 			} else if (result == 0) {
diff -ur ncftp-3.2.3/sio/SRecvmsg.c ncftp-3.2.3.fixed/sio/SRecvmsg.c
--- ncftp-3.2.3/sio/SRecvmsg.c	2003-09-01 04:22:23.000000000 +0200
+++ ncftp-3.2.3.fixed/sio/SRecvmsg.c	2009-12-14 14:13:19.000000000 +0100
@@ -64,7 +64,7 @@
 			tv.tv_sec = (tv_sec_t) tleft;
 			tv.tv_usec = 0;
 			result = select(sfd + 1, SELECT_TYPE_ARG234 &ss, NULL, NULL, SELECT_TYPE_ARG5 &tv);
-			if (result == 1) {
+			if (result >= 1) {
 				/* ready */
 				break;
 			} else if (result == 0) {
diff -ur ncftp-3.2.3/sio/SSend.c ncftp-3.2.3.fixed/sio/SSend.c
--- ncftp-3.2.3/sio/SSend.c	2003-09-01 04:25:09.000000000 +0200
+++ ncftp-3.2.3.fixed/sio/SSend.c	2009-12-14 14:14:24.000000000 +0100
@@ -60,7 +60,7 @@
 			tv.tv_sec = (tv_sec_t) tlen;
 			tv.tv_usec = 0;
 			result = select(sfd + 1, NULL, SELECT_TYPE_ARG234 &ss, NULL, SELECT_TYPE_ARG5 &tv);
-			if (result == 1) {
+			if (result >= 1) {
 				/* ready */
 				break;
 			} else if (result == 0) {
diff -ur ncftp-3.2.3/sio/SSendto.c ncftp-3.2.3.fixed/sio/SSendto.c
--- ncftp-3.2.3/sio/SSendto.c	2003-09-01 04:25:54.000000000 +0200
+++ ncftp-3.2.3.fixed/sio/SSendto.c	2009-12-14 14:14:48.000000000 +0100
@@ -43,7 +43,7 @@
 			tv.tv_sec = (tv_sec_t) tleft;
 			tv.tv_usec = 0;
 			result = select(sfd + 1, NULL, SELECT_TYPE_ARG234 &ss, NULL, SELECT_TYPE_ARG5 &tv);
-			if (result == 1) {
+			if (result >= 1) {
 				/* ready */
 				break;
 			} else if (result == 0) {
diff -ur ncftp-3.2.3/sio/SSendtoByName.c ncftp-3.2.3.fixed/sio/SSendtoByName.c
--- ncftp-3.2.3/sio/SSendtoByName.c	2003-09-01 04:26:18.000000000 +0200
+++ ncftp-3.2.3.fixed/sio/SSendtoByName.c	2009-12-14 14:15:28.000000000 +0100
@@ -46,7 +46,7 @@
 			tv.tv_sec = (tv_sec_t) tleft;
 			tv.tv_usec = 0;
 			result = select(sfd + 1, NULL, SELECT_TYPE_ARG234 &ss, NULL, SELECT_TYPE_ARG5 &tv);
-			if (result == 1) {
+			if (result >= 1) {
 				/* ready */
 				break;
 			} else if (result == 0) {
diff -ur ncftp-3.2.3/sio/SWait.c ncftp-3.2.3.fixed/sio/SWait.c
--- ncftp-3.2.3/sio/SWait.c	2005-01-01 21:44:48.000000000 +0100
+++ ncftp-3.2.3.fixed/sio/SWait.c	2009-12-14 14:16:57.000000000 +0100
@@ -34,7 +34,7 @@
 #endif
 			ss2 = ss;
 			result = select(sfd + 1, SELECT_TYPE_ARG234 &ss, NULL, SELECT_TYPE_ARG234 &ss2, NULL);
-			if (result == 1) {
+			if (result >= 1) {
 				/* ready */
 				return (1);
 			} else if ((result < 0) && (errno != EINTR)) {
@@ -59,7 +59,7 @@
 			tv.tv_sec = 0;
 			tv.tv_usec = 0;
 			result = select(sfd + 1, SELECT_TYPE_ARG234 &ss, NULL, SELECT_TYPE_ARG234 &ss2, &tv);
-			if (result == 1) {
+			if (result >= 1) {
 				/* ready */
 				return (1);
 			} else if (result == 0) {
@@ -93,7 +93,7 @@
 		tv.tv_sec = (tv_sec_t) tleft;
 		tv.tv_usec = 0;
 		result = select(sfd + 1, SELECT_TYPE_ARG234 &ss, NULL, SELECT_TYPE_ARG234 &ss2, &tv);
-		if (result == 1) {
+		if (result >= 1) {
 			/* ready */
 			return (1);
 		} else if (result < 0) {
@@ -153,7 +153,7 @@
 #endif
 			ss2 = ss;
 			result = select(sfd + 1, NULL, SELECT_TYPE_ARG234 &ss, SELECT_TYPE_ARG234 &ss2, NULL);
-			if (result == 1) {
+			if (result >= 1) {
 				/* ready */
 				return (1);
 			} else if ((result < 0) && (errno != EINTR)) {
@@ -178,7 +178,7 @@
 			tv.tv_sec = 0;
 			tv.tv_usec = 0;
 			result = select(sfd + 1, NULL, SELECT_TYPE_ARG234 &ss, SELECT_TYPE_ARG234 &ss2, &tv);
-			if (result == 1) {
+			if (result >= 1) {
 				/* ready */
 				return (1);
 			} else if (result == 0) {
@@ -212,7 +212,7 @@
 		tv.tv_sec = (tv_sec_t) tleft;
 		tv.tv_usec = 0;
 		result = select(sfd + 1, NULL, SELECT_TYPE_ARG234 &ss, SELECT_TYPE_ARG234 &ss2, &tv);
-		if (result == 1) {
+		if (result >= 1) {
 			/* ready */
 			return (1);
 		} else if (result < 0) {
diff -ur ncftp-3.2.3/sio/SWrite.c ncftp-3.2.3.fixed/sio/SWrite.c
--- ncftp-3.2.3/sio/SWrite.c	2003-09-01 04:36:42.000000000 +0200
+++ ncftp-3.2.3.fixed/sio/SWrite.c	2009-12-14 14:17:23.000000000 +0100
@@ -62,7 +62,7 @@
 				tv.tv_sec = (tv_sec_t) tlen;
 				tv.tv_usec = 0;
 				result = select(sfd + 1, NULL, SELECT_TYPE_ARG234 &ss, NULL, SELECT_TYPE_ARG5 &tv);
-				if (result == 1) {
+				if (result >= 1) {
 					/* ready */
 					break;
 				} else if (result == 0) {
diff -ur ncftp-3.2.3/sio/UAccept.c ncftp-3.2.3.fixed/sio/UAccept.c
--- ncftp-3.2.3/sio/UAccept.c	2003-09-01 04:37:30.000000000 +0200
+++ ncftp-3.2.3.fixed/sio/UAccept.c	2009-12-14 14:17:50.000000000 +0100
@@ -47,7 +47,7 @@
 		tv.tv_sec = (tv_sec_t) tlen;
 		tv.tv_usec = 0;
 		result = select(sfd + 1, SELECT_TYPE_ARG234 &ss, NULL, NULL, &tv);
-		if (result == 1) {
+		if (result >= 1) {
 			/* ready */
 			break;
 		} else if (result == 0) {
diff -ur ncftp-3.2.3/sio/URecvfrom.c ncftp-3.2.3.fixed/sio/URecvfrom.c
--- ncftp-3.2.3/sio/URecvfrom.c	2003-09-01 04:38:46.000000000 +0200
+++ ncftp-3.2.3.fixed/sio/URecvfrom.c	2009-12-14 14:18:39.000000000 +0100
@@ -41,7 +41,7 @@
 			tv.tv_sec = (tv_sec_t) tleft;
 			tv.tv_usec = 0;
 			result = select(sfd + 1, SELECT_TYPE_ARG234 &ss, NULL, NULL, SELECT_TYPE_ARG5 &tv);
-			if (result == 1) {
+			if (result >= 1) {
 				/* ready */
 				break;
 			} else if (result == 0) {
diff -ur ncftp-3.2.3/sio/USendto.c ncftp-3.2.3.fixed/sio/USendto.c
--- ncftp-3.2.3/sio/USendto.c	2003-09-01 04:39:31.000000000 +0200
+++ ncftp-3.2.3.fixed/sio/USendto.c	2009-12-14 14:19:17.000000000 +0100
@@ -43,7 +43,7 @@
 			tv.tv_sec = (tv_sec_t) tleft;
 			tv.tv_usec = 0;
 			result = select(sfd + 1, NULL, SELECT_TYPE_ARG234 &ss, NULL, SELECT_TYPE_ARG5 &tv);
-			if (result == 1) {
+			if (result >= 1) {
 				/* ready */
 				break;
 			} else if (result == 0) {


More information about the freebsd-stable mailing list