Package: rsync
Version: 2.6.4-6
Severity: normal
Tags: patch

when trying to copy files to destinations that contain colons
(on an rsync server), rsync misparses the url commandline.

this fails:
$ rsync /tmp/somefile rsync://[EMAIL PROTECTED]/module/a:10:b
rsync: getaddrinfo: otherbox/module/a 10: Name or service not known
rsync error: error in socket IO (code 10) at clientserver.c(99)

the problem is in options.c, lines 1528++: after cutting off the 
url prefix and finding out where the path begins (first /), 
the search for colons is not limited to the hostname component but
instead runs over the total string. 

the simplest fix is to check if the colon was found within the
host part of the string.

--- options.c   2006-06-02 14:32:26.000000000 +1000
+++ options.c.fixed       2006-06-02 14:53:57.000000000 +1000
@@ -1525,7 +1525,7 @@
                        if (p[1] == ':')
                                *port_ptr = atoi(p+2);
                } else {
-                       if ((p = strchr(s, ':')) != NULL) {
+                       if ((p = strchr(s, ':')) != NULL && s+hostlen>p) {
                                hostlen = p - s;
                                *port_ptr = atoi(p+1);
                        }
note also that this invocation can be used as workaround:
$ rsync /tmp/somefile [EMAIL PROTECTED]::module/a:10:b

regards
az

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (980, 'testing'), (970, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.14
Locale: LANG=C, LC_CTYPE=de_AT (charmap=ISO-8859-1)

Versions of packages rsync depends on:
ii  libc6                 2.3.2.ds1-22sarge3 GNU C Library: Shared libraries an
ii  libpopt0              1.7-5              lib for parsing cmdline parameters

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to