[SCM] The rsync repository. - branch master updated
Rsync CVS commit messages
rsync-cvs at lists.samba.org
Sun Oct 2 17:01:53 UTC 2022
The branch, master has been updated
via 77dd3047 Mention latest changes.
via 25efa108 Complain if the destination arg is empty.
via fdf5e577 Read a 4-byte mtime as unsigned (old-protocol).
via 19bd0dd3 Use newer protocol to avoid mtime corruption.
from ed4b3448 Preparing for release of 3.2.7pre1
https://git.samba.org/?p=rsync.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 77dd3047666fa68ce2acb88f4be0e5ebca83fb50
Author: Wayne Davison <wayne at opencoder.net>
Date: Sun Oct 2 09:42:55 2022 -0700
Mention latest changes.
commit 25efa10802dd416529d5dbaaac20a485db1f33b2
Author: Wayne Davison <wayne at opencoder.net>
Date: Sun Oct 2 09:42:17 2022 -0700
Complain if the destination arg is empty.
commit fdf5e577f59cf709eb3559137ce3be1431522d07
Author: Wayne Davison <wayne at opencoder.net>
Date: Sat Oct 1 08:23:47 2022 -0700
Read a 4-byte mtime as unsigned (old-protocol).
When conversing with a protocol 29 or earlier rsync, the modtime values
are arriving as 4-byte integers. This change interprets these short
values as unsigned integers, allowing the time that can be conveyed to
range from 1-Jan-1970 to 7-Feb-2106 instead of the signed range of
13-Dec-1901 to 19-Jan-2038. Given that we are fast approaching 2038,
any old-protocol transfers will be better served using the unsigned
range rather than the signed.
It is important to keep in mind that protocol 30 & 31 convey the full
8-byte mtime value (plus nanoseconds), allowing for a huge span of time
that is not affected by this change.
commit 19bd0dd34022d0b8e2ae45f12029602f129c28c1
Author: Wayne Davison <wayne at opencoder.net>
Date: Sat Oct 1 08:04:00 2022 -0700
Use newer protocol to avoid mtime corruption.
-----------------------------------------------------------------------
Summary of changes:
NEWS.md | 26 ++++++++++++++++++++------
flist.c | 2 +-
io.c | 7 +++++++
main.c | 15 +++++++++++++--
rsync.1.md | 13 ++++++++++++-
testsuite/exclude.test | 2 +-
6 files changed, 54 insertions(+), 11 deletions(-)
Changeset truncated at 500 lines:
diff --git a/NEWS.md b/NEWS.md
index 3b49c2d4..a27d8081 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -25,8 +25,8 @@
- Added support for the SHA1 digest in file checksums. While this tends to be
overkill, it is available if someone really needs it. This overly-long
checksum is at the lowest priority in the normal checksum negotiation list.
- See `--checksum-choice` (`--cc`) and the `RSYNC_CHECKSUM_LIST` environment
- var for how to customize this.
+ See [`--checksum-choice`](rsync.1#opt) (`--cc`) and the `RSYNC_CHECKSUM_LIST`
+ environment var for how to customize this.
- Improved the xattr hash table to use a 64-bit key without slowing down the
key's computation. This should make extra sure that a collision doesn't
@@ -42,15 +42,29 @@
converted. Newer rsync versions will provide more complete json info than
older rsync versions.
-- The [`use chroot`](rsyncd.conf.5#use_chroot) daemon parameter now defaults to
- "unset" so that rsync can use chroot when it works and a sanitized copy when
- chroot is not supported (e.g., for a non-root daemon). Explicitly setting
- the parameter to true or false (on or off) behaves the same way as before.
+- The [`use chroot`](rsyncd.conf.5#) daemon parameter now defaults to "unset"
+ so that rsync can use chroot when it works and a sanitized copy when chroot
+ is not supported (e.g., for a non-root daemon). Explicitly setting the
+ parameter to true or false (on or off) behaves the same way as before.
- The `--fuzzy` option was optimized a bit to try to cut down on the amount of
computations when considering a big pool of files. The simple heuristic from
Kenneth Finnegan resuled in about a 2x speedup.
+- If rsync is forced to use protocol 29 or before (perhaps due to talking to an
+ rsync before 3.0.0), the modify time of a file is limited to 4-bytes. Rsync
+ now interprets this value as an unsigned integer so that a current year past
+ 2038 can continue to be represented. This does mean that years prior to 1970
+ cannot be represented in an older protocol, but this trade-off seems like the
+ rigth choice given that (1) 2038 is very rapidly approaching, and (2) newer
+ protocols support a much wider range of old and new dates.
+
+- The rsync client now treats an empty destination arg as an error, just like
+ it does for an empty source arg. This doesn't affect a `host:` arg (which is
+ treated the same as `host:.`) since the arg is not completely empty. The use
+ of [`--old-args`](rsync.1#opt) (including via `RSYNC_OLD_ARGS`) allows the
+ prior behavior of treating an empty destination arg as a ".".
+
### PACKAGING RELATED:
- The checksum code now uses openssl's EVP methods, which gets rid of various
diff --git a/flist.c b/flist.c
index 82d686a6..65b459b1 100644
--- a/flist.c
+++ b/flist.c
@@ -836,7 +836,7 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
}
#endif
} else
- modtime = read_int(f);
+ modtime = read_uint(f);
}
if (xflags & XMIT_MOD_NSEC)
#ifndef CAN_SET_NSEC
diff --git a/io.c b/io.c
index f3d802ec..a99ac0ec 100644
--- a/io.c
+++ b/io.c
@@ -1784,6 +1784,13 @@ int32 read_int(int f)
return num;
}
+uint32 read_uint(int f)
+{
+ char b[4];
+ read_buf(f, b, 4);
+ return IVAL(b, 0);
+}
+
int32 read_varint(int f)
{
union {
diff --git a/main.c b/main.c
index 02b70079..d2a7b9b5 100644
--- a/main.c
+++ b/main.c
@@ -660,6 +660,16 @@ static pid_t do_cmd(char *cmd, char *machine, char *user, char **remote_argv, in
return pid;
}
+/* Older versions turn an empty string as a reference to the current directory.
+ * We now treat this as an error unless --old-args was used. */
+static char *dot_dir_or_error()
+{
+ if (old_style_args || am_server)
+ return ".";
+ rprintf(FERROR, "Empty destination arg specified (use \".\" or see --old-args).\n");
+ exit_cleanup(RERR_SYNTAX);
+}
+
/* The receiving side operates in one of two modes:
*
* 1. it receives any number of files into a destination directory,
@@ -687,9 +697,8 @@ static char *get_local_name(struct file_list *flist, char *dest_path)
if (!dest_path || list_only)
return NULL;
- /* Treat an empty string as a copy into the current directory. */
if (!*dest_path)
- dest_path = ".";
+ dest_path = dot_dir_or_error();
if (daemon_filter_list.head) {
char *slash = strrchr(dest_path, '/');
@@ -1432,6 +1441,8 @@ static int start_client(int argc, char *argv[])
if (argc > 1) {
p = argv[--argc];
+ if (!*p)
+ p = dot_dir_or_error();
remote_argv = argv + argc;
} else {
static char *dotarg[1] = { "." };
diff --git a/rsync.1.md b/rsync.1.md
index 029e4d82..7d96eca6 100644
--- a/rsync.1.md
+++ b/rsync.1.md
@@ -859,7 +859,7 @@ expand it.
that until a bunch of recursive copying has finished). However, these
early directories don't yet have their completed mode, mtime, or ownership
set -- they have more restrictive rights until the subdirectory's copying
- actually begins. This early-creation idiom can be avoiding by using the
+ actually begins. This early-creation idiom can be avoided by using the
[`--omit-dir-times`](#opt) option.
Incremental recursion can be disabled using the
@@ -1560,6 +1560,15 @@ expand it.
will make the update fairly efficient if the files haven't actually
changed, you're much better off using `-t`).
+ A modern rsync that is using transfer protocol 30 or 31 conveys a modify
+ time using up to 8-bytes. If rsync is forced to speak an older protocol
+ (perhaps due to the remote rsync being older than 3.0.0) a modify time is
+ conveyed using 4-bytes. Prior to 3.2.7, these shorter values could convey
+ a date range of 13-Dec-1901 to 19-Jan-2038. Beginning with 3.2.7, these
+ 4-byte values now convey a date range of 1-Jan-1970 to 7-Feb-2106. If you
+ have files dated older than 1970, make sure your rsync executables are
+ upgraded so that the full range of dates can be conveyed.
+
0. `--atimes`, `-U`
This tells rsync to set the access (use) times of the destination files to
@@ -2388,6 +2397,8 @@ expand it.
This option tells rsync to stop trying to protect the arg values on the
remote side from unintended word-splitting or other misinterpretation.
+ It also allows the client to treat an empty arg as a "." instead of
+ generating an error.
The default in a modern rsync is for "shell-active" characters (including
spaces) to be backslash-escaped in the args that are sent to the remote
diff --git a/testsuite/exclude.test b/testsuite/exclude.test
index 4b1a1a05..9b487b60 100644
--- a/testsuite/exclude.test
+++ b/testsuite/exclude.test
@@ -188,7 +188,7 @@ rm "$chkdir"/bar/down/to/foo/.filt2
rm "$chkdir"/bar/down/to/bar/.filt2
rm "$chkdir"/mid/.filt
-$RSYNC -av --protocol=28 --existing --include='*/' --exclude='*' "$fromdir/" "$chkdir/"
+$RSYNC -av --existing --include='*/' --exclude='*' "$fromdir/" "$chkdir/"
# Now, try the prior command with --delete-before and some side-specific
# rules.
--
The rsync repository.
More information about the rsync-cvs
mailing list