[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Sun Apr 5 17:06:26 UTC 2020


The branch, master has been updated
       via  826ddc54 Enhance the validation of --block-size for older protocols. Fixes bug #13974.
       via  3bd4e1e8 Make the --copy-links caveat a little clearer.
       via  51e23e0a Use nanosleep if it is available. Fixes bug #14328.
      from  08650cb1 Add a --copy-as=USER[:GROUP] option

https://git.samba.org/?p=rsync.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 826ddc5403c7fc53e00dc3503d7451d99a930989
Author: Wayne Davison <wayned at samba.org>
Date:   Sun Apr 5 10:04:05 2020 -0700

    Enhance the validation of --block-size for older protocols.
    Fixes bug #13974.

commit 3bd4e1e8cd868840f29ae5eda2e1c604a72acbdf
Author: Wayne Davison <wayned at samba.org>
Date:   Sun Apr 5 09:43:59 2020 -0700

    Make the --copy-links caveat a little clearer.

commit 51e23e0ab73016482d4eba73208bb63226f7493a
Author: Wayne Davison <wayned at samba.org>
Date:   Sun Apr 5 09:22:00 2020 -0700

    Use nanosleep if it is available.
    Fixes bug #14328.

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

Summary of changes:
 configure.ac |  2 +-
 options.c    | 15 +++++++++++----
 rsync.yo     |  9 +++++----
 util2.c      | 14 +++++++++++---
 4 files changed, 28 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/configure.ac b/configure.ac
index 4f68e98a..0756242f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -599,7 +599,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
     setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \
     seteuid strerror putenv iconv_open locale_charset nl_langinfo getxattr \
     extattr_get_link sigaction sigprocmask setattrlist getgrouplist \
-    initgroups utimensat posix_fallocate attropen setvbuf usleep)
+    initgroups utimensat posix_fallocate attropen setvbuf nanosleep usleep)
 
 dnl cygwin iconv.h defines iconv_open as libiconv_open
 if test x"$ac_cv_func_iconv_open" != x"yes"; then
diff --git a/options.c b/options.c
index a9b07184..3464f9dd 100644
--- a/options.c
+++ b/options.c
@@ -1984,10 +1984,17 @@ int parse_arguments(int *argc_p, const char ***argv_p)
 	}
 #endif
 
-	if (block_size > MAX_BLOCK_SIZE) {
-		snprintf(err_buf, sizeof err_buf,
-			 "--block-size=%lu is too large (max: %u)\n", block_size, MAX_BLOCK_SIZE);
-		return 0;
+	if (block_size) {
+		/* We may not know the real protocol_version at this point if this is the client
+		 * option parsing, but we still want to check it so that the client can specify
+		 * a --protocol=29 option with a larger block size. */
+		int32 max_blength = protocol_version < 30 ? OLD_MAX_BLOCK_SIZE : MAX_BLOCK_SIZE;
+
+		if (block_size > max_blength) {
+			snprintf(err_buf, sizeof err_buf,
+				 "--block-size=%lu is too large (max: %u)\n", block_size, max_blength);
+			return 0;
+		}
 	}
 
 	if (write_batch && read_batch) {
diff --git a/rsync.yo b/rsync.yo
index 1950349c..fdaf3d27 100644
--- a/rsync.yo
+++ b/rsync.yo
@@ -940,10 +940,11 @@ additional effect if bf(--copy-links) was also specified.
 
 Note that the cut-off point is the top of the transfer, which is the part of
 the path that rsync isn't mentioning in the verbose output.  If you copy
-"subdir" to "/dest/" then the subdir directory is a name inside the transfer
-tree, not the top of the transfer (its parent directory is the top) so it is
-legal for created relative symlinks to refer to other names inside the /dest
-dir.
+"/src/subdir" to "/dest/" then the "subdir" directory is a name inside the
+transfer tree, not the top of the transfer (which is /src) so it is legal for
+created relative symlinks to refer to other names inside the /src and /dest
+directories. If you instead copy "/src/subdir/" (with a trailing slash) to
+"/dest/subdir" that would not allow symlinks to any files outside of "subdir".
 
 dit(bf(--safe-links)) This tells rsync to ignore any symbolic links
 which point outside the copied tree. All absolute symlinks are
diff --git a/util2.c b/util2.c
index 619c92eb..b46677c0 100644
--- a/util2.c
+++ b/util2.c
@@ -28,13 +28,21 @@
 /**
  * Sleep for a specified number of milliseconds.
  *
- * Always returns TRUE.  (In the future it might return FALSE if
- * interrupted.)
+ * Always returns True.
  **/
 int msleep(int t)
 {
-#ifdef HAVE_USLEEP
+#ifdef HAVE_NANOSLEEP
+	struct timespec ts;
+
+	ts.tv_sec = t / 1000;
+	ts.tv_nsec = (t % 1000) * 1000000L;
+
+	while (nanosleep(&ts, &ts) < 0 && errno == EINTR) {}
+
+#elif defined HAVE_USLEEP
 	usleep(t*1000);
+
 #else
 	int tdiff = 0;
 	struct timeval tval, t1, t2;


-- 
The rsync repository.



More information about the rsync-cvs mailing list