[See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=369904 ]

The following patch stops rsync from confusing the 123 in the following
command line with the port number:

$ rsync /tmp/somefile rsync://[EMAIL PROTECTED]/module/a:123:b
rsync: getaddrinfo: otherbox/module/a 123: Name or service not known

Paul Slootman

Index: options.c
===================================================================
RCS file: /cvsroot/rsync/options.c,v
retrieving revision 1.393
diff -u -r1.393 options.c
--- options.c   24 Jul 2007 04:09:46 -0000      1.393
+++ options.c   1 Aug 2007 12:25:40 -0000
@@ -1981,7 +1981,7 @@
                        if (p[1] == ':')
                                *port_ptr = atoi(p+2);
                } else {
-                       if ((p = strchr(s, ':')) != NULL) {
+                       if ((p = strchr(s, ':')) != NULL && p < s + hostlen) {
                                hostlen = p - s;
                                *port_ptr = atoi(p+1);
                        }
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to