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

Rsync CVS commit messages rsync-cvs at lists.samba.org
Sat Sep 10 14:41:44 MDT 2011


The branch, b3.0.x has been updated
       via  ae6dea7 Mention the latest changes in the NEWS.
       via  5a9933c Error out if --password-file specifed and it fails. Fixes bug 8440.
       via  b91ab5f Dirs need +rx as well as +w for non-super xfers. Partial fix for bug 8242.
      from  5340571 Move implied_dot_dir=1, just to be safe.

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


- Log -----------------------------------------------------------------
commit ae6dea711d77d189ec7ff098fd3eaa9842fb8a16
Author: Wayne Davison <wayned at samba.org>
Date:   Sat Sep 10 13:40:48 2011 -0700

    Mention the latest changes in the NEWS.

commit 5a9933c85cca18f0b3991a93e40bc8b00b23ed8c
Author: Wayne Davison <wayned at samba.org>
Date:   Tue Sep 6 21:18:32 2011 -0700

    Error out if --password-file specifed and it fails.
    Fixes bug 8440.

commit b91ab5f9c87b5e725e838bd386fe8e9cc3cb28d6
Author: Wayne Davison <wayned at samba.org>
Date:   Sat Sep 3 12:40:12 2011 -0700

    Dirs need +rx as well as +w for non-super xfers.
    Partial fix for bug 8242.

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

Summary of changes:
 NEWS           |   26 ++++++++++++++++++++++++++
 authenticate.c |   36 ++++++++++++++----------------------
 generator.c    |   11 ++++++-----
 3 files changed, 46 insertions(+), 27 deletions(-)


Changeset truncated at 500 lines:

diff --git a/NEWS b/NEWS
index 670f402..980754e 100644
--- a/NEWS
+++ b/NEWS
@@ -17,9 +17,35 @@ Changes since 3.0.8:
 
     - Fix the updating of the curr_dir buffer to avoid a duplicate slash.
 
+    - Fix the directory permissions on an implied dot-dir when using --relative
+      (e.g. /outside/path/././send/path).
+
+    - Fixed some too-long sleeping instances when using --bwlimit.
+
+    - Fixed when symlink ownership difference-checking gets compiled into
+      unchanged_attrs().
+
+    - Improved the socket-error reporting when multiple protocols fail.
+
+    - Fixed a case where a socket error could reference just-freed memory.
+
+    - Failing to use a password file that was specified on the command-line is
+      now a fatal error.
+
+    - Fix the non-root updating of directories that don't have the read and/or
+      execute permission.
+
     - Make daemon-excluded file errors more error-like.
 
     - Fix a compilation issue on older C compilers (due to a misplaced var
       declaration).
 
+    - Make configure avoid finding socketpair on cygwin.
+
+    - Avoid trying to reference SO_BROADCAST if the OS doesn't support it.
+
     - Fix some issues with the post-processing of the man pages.
+
+    - Fixed the user home-dir handling in the support/lsh script.
+
+    - Some minor manpage improvements.
diff --git a/authenticate.c b/authenticate.c
index 3af7337..7650377 100644
--- a/authenticate.c
+++ b/authenticate.c
@@ -156,36 +156,27 @@ static const char *getpassf(const char *filename)
 {
 	STRUCT_STAT st;
 	char buffer[512], *p;
-	int fd, n, ok = 1;
-	const char *envpw = getenv("RSYNC_PASSWORD");
+	int fd, n;
 
 	if (!filename)
 		return NULL;
 
 	if ((fd = open(filename,O_RDONLY)) < 0) {
-		rsyserr(FWARNING, errno, "could not open password file \"%s\"",
-			filename);
-		if (envpw)
-			rprintf(FINFO, "falling back to RSYNC_PASSWORD environment variable.\n");
-		return NULL;
+		rsyserr(FERROR, errno, "could not open password file %s", filename);
+		exit_cleanup(RERR_SYNTAX);
 	}
 
 	if (do_stat(filename, &st) == -1) {
-		rsyserr(FWARNING, errno, "stat(%s)", filename);
-		ok = 0;
-	} else if ((st.st_mode & 06) != 0) {
-		rprintf(FWARNING, "password file must not be other-accessible\n");
-		ok = 0;
-	} else if (MY_UID() == 0 && st.st_uid != 0) {
-		rprintf(FWARNING, "password file must be owned by root when running as root\n");
-		ok = 0;
+		rsyserr(FERROR, errno, "stat(%s)", filename);
+		exit_cleanup(RERR_SYNTAX);
 	}
-	if (!ok) {
-		close(fd);
-		rprintf(FWARNING, "continuing without password file\n");
-		if (envpw)
-			rprintf(FINFO, "falling back to RSYNC_PASSWORD environment variable.\n");
-		return NULL;
+	if ((st.st_mode & 06) != 0) {
+		rprintf(FERROR, "ERROR: password file must not be other-accessible\n");
+		exit_cleanup(RERR_SYNTAX);
+	}
+	if (MY_UID() == 0 && st.st_uid != 0) {
+		rprintf(FERROR, "ERROR: password file must be owned by root when running as root\n");
+		exit_cleanup(RERR_SYNTAX);
 	}
 
 	n = read(fd, buffer, sizeof buffer - 1);
@@ -196,7 +187,8 @@ static const char *getpassf(const char *filename)
 			return strdup(p);
 	}
 
-	return NULL;
+	rprintf(FERROR, "ERROR: failed to read a password from %s\n", filename);
+	exit_cleanup(RERR_SYNTAX);
 }
 
 /* Generate an MD4 hash created from the combination of the password
diff --git a/generator.c b/generator.c
index da6138a..91fd687 100644
--- a/generator.c
+++ b/generator.c
@@ -1531,12 +1531,13 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
 		    && verbose && code != FNONE && f_out != -1)
 			rprintf(code, "%s/\n", fname);
 
-		/* We need to ensure that the dirs in the transfer have writable
-		 * permissions during the time we are putting files within them.
-		 * This is then fixed after the transfer is done. */
+		/* We need to ensure that the dirs in the transfer have both
+		 * readable and writable permissions during the time we are
+		 * putting files within them.  This is then restored to the
+		 * former permissions after the transfer is done. */
 #ifdef HAVE_CHMOD
-		if (!am_root && !(file->mode & S_IWUSR) && dir_tweaking) {
-			mode_t mode = file->mode | S_IWUSR;
+		if (!am_root && (file->mode & S_IRWXU) != S_IRWXU && dir_tweaking) {
+			mode_t mode = file->mode | S_IRWXU;
 			if (do_chmod(fname, mode) < 0) {
 				rsyserr(FERROR_XFER, errno,
 					"failed to modify permissions on %s",


-- 
The rsync repository.


More information about the rsync-cvs mailing list