[SCM] The rsync repository. - branch b3.0.x updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Sat Jan 1 15:02:06 MST 2011


The branch, b3.0.x has been updated
       via  63c5ac3 Report all socket connection errors if we fail. Fixes bug 6588.
       via  ce41e68 Itemize xattrs of a missing dir from an alt-dest dir. Fixes bug 6576.
       via  8538db7 Use full_fname() for system error messages.
       via  559bd2f Tweak the year.
      from  485a403 Protect a remote filename that starts with a dash.

;a=shortlog;h=b3.0.x


- Log -----------------------------------------------------------------
commit 63c5ac38a2c5b121fff636650aa9f25fd2952ace
Author: Wayne Davison <wayned at samba.org>
Date:   Sat Jan 1 13:54:16 2011 -0800

    Report all socket connection errors if we fail.
    Fixes bug 6588.

commit ce41e68995d2e9a0d961b322348c849e39142e67
Author: Wayne Davison <wayned at samba.org>
Date:   Sat Jan 1 12:54:07 2011 -0800

    Itemize xattrs of a missing dir from an alt-dest dir.
    Fixes bug 6576.

commit 8538db7829b8584b78e23fba01253add3a355aa8
Author: Wayne Davison <wayned at samba.org>
Date:   Sat Jan 1 12:29:36 2011 -0800

    Use full_fname() for system error messages.

commit 559bd2ff31eb389c94ca94c7d2d63bb1d4095ee0
Author: Wayne Davison <wayned at samba.org>
Date:   Sat Jan 1 11:27:40 2011 -0800

    Tweak the year.

-----------------------------------------------------------------------

Summary of changes:
 OLDNEWS     |    2 +-
 generator.c |    9 ++++++---
 options.c   |    4 ++--
 socket.c    |   28 +++++++++++++++++++++++-----
 xattrs.c    |   18 +++++++++---------
 5 files changed, 41 insertions(+), 20 deletions(-)


Changeset truncated at 500 lines:

diff --git a/OLDNEWS b/OLDNEWS
index 2f17ac1..3922c79 100644
--- a/OLDNEWS
+++ b/OLDNEWS
@@ -3094,7 +3094,7 @@ Changes since 2.4.6:
 
 Partial Protocol History
 	RELEASE DATE	VER.	DATE OF COMMIT*	PROTOCOL
-	?? ??? 2010	3.0.8			30
+	?? ??? 2011	3.0.8			30
 	31 Dec 2009	3.0.7			30
 	08 May 2009	3.0.6			30
 	28 Dec 2008	3.0.5			30
diff --git a/generator.c b/generator.c
index 635fcb9..c2fbc06 100644
--- a/generator.c
+++ b/generator.c
@@ -1408,6 +1408,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
 		goto cleanup;
 	}
 
+	fnamecmp = fname;
+
 	if (is_dir) {
 		if (!implied_dirs && file->flags & FLAG_IMPLIED_DIR)
 			goto cleanup;
@@ -1455,11 +1457,13 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
 				itemizing = 0;
 				code = FNONE;
 				statret = 1;
-			} else if (j >= 0)
+			} else if (j >= 0) {
 				statret = 1;
+				fnamecmp = fnamecmpbuf;
+			}
 		}
 		if (itemizing && f_out != -1) {
-			itemize(fname, file, ndx, statret, &sx,
+			itemize(fnamecmp, file, ndx, statret, &sx,
 				statret ? ITEM_LOCAL_CHANGE : 0, 0, NULL);
 		}
 		if (real_ret != 0 && do_mkdir(fname,file->mode) < 0 && errno != EEXIST) {
@@ -1739,7 +1743,6 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
 		goto cleanup;
 	}
 
-	fnamecmp = fname;
 	fnamecmp_type = FNAMECMP_FNAME;
 
 	if (statret == 0 && !S_ISREG(sx.st.st_mode)) {
diff --git a/options.c b/options.c
index 075c890..579c430 100644
--- a/options.c
+++ b/options.c
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 1998-2001 Andrew Tridgell <tridge at samba.org>
  * Copyright (C) 2000, 2001, 2002 Martin Pool <mbp at samba.org>
- * Copyright (C) 2002-2010 Wayne Davison
+ * Copyright (C) 2002-2011 Wayne Davison
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -259,7 +259,7 @@ static void print_rsync_version(enum logcode f)
 
 	rprintf(f, "%s  version %s  protocol version %d%s\n",
 		RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION, subprotocol);
-	rprintf(f, "Copyright (C) 1996-2010 by Andrew Tridgell, Wayne Davison, and others.\n");
+	rprintf(f, "Copyright (C) 1996-2011 by Andrew Tridgell, Wayne Davison, and others.\n");
 	rprintf(f, "Web site: http://rsync.samba.org/\n");
 	rprintf(f, "Capabilities:\n");
 	rprintf(f, "    %d-bit files, %d-bit inums, %d-bit timestamps, %d-bit long ints,\n",
diff --git a/socket.c b/socket.c
index e496755..89a636f 100644
--- a/socket.c
+++ b/socket.c
@@ -182,7 +182,7 @@ int open_socket_out(char *host, int port, const char *bind_addr,
 		    int af_hint)
 {
 	int type = SOCK_STREAM;
-	int error, s;
+	int error, s, j, addr_cnt, *errnos;
 	struct addrinfo hints, *res0, *res;
 	char portbuf[10];
 	char *h, *cp;
@@ -244,12 +244,17 @@ int open_socket_out(char *host, int port, const char *bind_addr,
 		return -1;
 	}
 
+	for (res = res0, addr_cnt = 0; res; res = res->ai_next, addr_cnt++) {}
+	errnos = new_array0(int, addr_cnt);
+	if (!errnos)
+		out_of_memory("open_socket_out");
+
 	s = -1;
 	/* Try to connect to all addresses for this machine until we get
 	 * through.  It might e.g. be multi-homed, or have both IPv4 and IPv6
 	 * addresses.  We need to create a socket for each record, since the
 	 * address record tells us what protocol to use to try to connect. */
-	for (res = res0; res; res = res->ai_next) {
+	for (res = res0, j = 0; res; res = res->ai_next, j++) {
 		s = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
 		if (s < 0)
 			continue;
@@ -280,8 +285,10 @@ int open_socket_out(char *host, int port, const char *bind_addr,
 		if (connect_timeout > 0)
 			alarm(0);
 
-		if (s < 0)
+		if (s < 0) {
+			errnos[j] = errno;
 			continue;
+		}
 
 		if (proxied
 		 && establish_proxy_connection(s, host, port,
@@ -293,10 +300,21 @@ int open_socket_out(char *host, int port, const char *bind_addr,
 		break;
 	}
 	freeaddrinfo(res0);
+
 	if (s < 0) {
-		rsyserr(FERROR, errno, "failed to connect to %s", h);
-		return -1;
+		char buf[2048];
+		for (res = res0, j = 0; res; res = res->ai_next, j++) {
+			if (errnos[j] == 0)
+				continue;
+			if (inet_ntop(res->ai_family, res->ai_addr->sa_data + 2, buf, sizeof buf) == NULL)
+				strlcpy(buf, "*inet_ntop failed*", sizeof buf);
+			rsyserr(FERROR, errnos[j], "failed to connect to %s (%s)", h, buf);
+		}
+		s = -1;
 	}
+
+	free(errnos);
+
 	return s;
 }
 
diff --git a/xattrs.c b/xattrs.c
index a0b2583..cc8f8d7 100644
--- a/xattrs.c
+++ b/xattrs.c
@@ -138,7 +138,7 @@ static ssize_t get_xattr_names(const char *fname)
 		  got_error:
 			rsyserr(FERROR_XFER, errno,
 				"get_xattr_names: llistxattr(\"%s\",%.0f) failed",
-				fname, arg);
+				full_fname(fname), arg);
 			return -1;
 		}
 		list_len = sys_llistxattr(fname, NULL, 0);
@@ -174,7 +174,7 @@ static char *get_xattr_data(const char *fname, const char *name, size_t *len_ptr
 			return NULL;
 		rsyserr(FERROR_XFER, errno,
 			"get_xattr_data: lgetxattr(\"%s\",\"%s\",0) failed",
-			fname, name);
+			full_fname(fname), name);
 		return NULL;
 	}
 
@@ -191,11 +191,11 @@ static char *get_xattr_data(const char *fname, const char *name, size_t *len_ptr
 			if (len == (size_t)-1) {
 				rsyserr(FERROR_XFER, errno,
 				    "get_xattr_data: lgetxattr(\"%s\",\"%s\",%ld)"
-				    " failed", fname, name, (long)datum_len);
+				    " failed", full_fname(fname), name, (long)datum_len);
 			} else {
 				rprintf(FERROR_XFER,
 				    "get_xattr_data: lgetxattr(\"%s\",\"%s\",%ld)"
-				    " returned %ld\n", fname, name,
+				    " returned %ld\n", full_fname(fname), name,
 				    (long)datum_len, (long)len);
 			}
 			free(ptr);
@@ -322,7 +322,7 @@ int copy_xattrs(const char *source, const char *dest)
 			int save_errno = errno ? errno : EINVAL;
 			rsyserr(FERROR_XFER, errno,
 				"copy_xattrs: lsetxattr(\"%s\",\"%s\") failed",
-				dest, name);
+				full_fname(dest), name);
 			errno = save_errno;
 			return -1;
 		}
@@ -807,7 +807,7 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
 			else if (sys_lsetxattr(fname, name, ptr, len) < 0) {
 				rsyserr(FERROR_XFER, errno,
 					"rsync_xal_set: lsetxattr(\"%s\",\"%s\") failed",
-					fname, name);
+					full_fname(fname), name);
 				ret = -1;
 			} else /* make sure caller sets mtime */
 				sxp->st.st_mtime = (time_t)-1;
@@ -828,7 +828,7 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
 		if (sys_lsetxattr(fname, name, rxas[i].datum, rxas[i].datum_len) < 0) {
 			rsyserr(FERROR_XFER, errno,
 				"rsync_xal_set: lsetxattr(\"%s\",\"%s\") failed",
-				fname, name);
+				full_fname(fname), name);
 			ret = -1;
 		} else /* make sure caller sets mtime */
 			sxp->st.st_mtime = (time_t)-1;
@@ -858,7 +858,7 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
 			if (sys_lremovexattr(fname, name) < 0) {
 				rsyserr(FERROR_XFER, errno,
 					"rsync_xal_set: lremovexattr(\"%s\",\"%s\") failed",
-					fname, name);
+					full_fname(fname), name);
 				ret = -1;
 			} else /* make sure caller sets mtime */
 				sxp->st.st_mtime = (time_t)-1;
@@ -901,7 +901,7 @@ int set_xattr_acl(const char *fname, int is_access_acl, const char *buf, size_t
 	if (sys_lsetxattr(fname, name, buf, buf_len) < 0) {
 		rsyserr(FERROR_XFER, errno,
 			"set_xattr_acl: lsetxattr(\"%s\",\"%s\") failed",
-			fname, name);
+			full_fname(fname), name);
 		return -1;
 	}
 	return 0;


-- 
The rsync repository.


More information about the rsync-cvs mailing list