[SCM] The rsync repository. - branch master updated
Rsync CVS commit messages
rsync-cvs at lists.samba.org
Mon Dec 4 00:29:52 UTC 2017
The branch, master has been updated
via f5e8a17 Fix issue with earlier path-check (fixes "make check") and make a BOOL more explicit.
via 5509597 Check daemon filter against fnamecmp in recv_files().
via 70aeb5f Sanitize xname in read_ndx_and_attrs.
via 3e06d40 Check fname in recv_files sooner.
from 416e719 More archaic-checksum improvements. This makes the len vars clearer and ensures that only the flist code gets the 2-byte digest len.
https://git.samba.org/?p=rsync.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit f5e8a17e093065fb20fea00a29540fe2c7896441
Author: Wayne Davison <wayned at samba.org>
Date: Sun Dec 3 15:49:56 2017 -0800
Fix issue with earlier path-check (fixes "make check")
and make a BOOL more explicit.
commit 5509597decdbd7b91994210f700329d8a35e70a1
Author: Jeriko One <jeriko.one at gmx.us>
Date: Thu Nov 16 17:26:03 2017 -0800
Check daemon filter against fnamecmp in recv_files().
commit 70aeb5fddd1b2f8e143276f8d5a085db16c593b9
Author: Jeriko One <jeriko.one at gmx.us>
Date: Thu Nov 16 17:05:42 2017 -0800
Sanitize xname in read_ndx_and_attrs.
commit 3e06d40029cfdce9d0f73d87cfd4edaf54be9c51
Author: Jeriko One <jeriko.one at gmx.us>
Date: Thu Nov 2 23:44:19 2017 -0700
Check fname in recv_files sooner.
-----------------------------------------------------------------------
Summary of changes:
checksum.c | 2 +-
receiver.c | 14 +++++++-------
rsync.c | 6 ++++++
3 files changed, 14 insertions(+), 8 deletions(-)
Changeset truncated at 500 lines:
diff --git a/checksum.c b/checksum.c
index 4c9351c..ad25635 100644
--- a/checksum.c
+++ b/checksum.c
@@ -73,7 +73,7 @@ int parse_csum_name(const char *name, int len)
exit_cleanup(RERR_UNSUPPORTED);
}
-int csum_len_for_type(int cst, int flist_csum)
+int csum_len_for_type(int cst, BOOL flist_csum)
{
switch (cst) {
case CSUM_NONE:
diff --git a/receiver.c b/receiver.c
index baae3a9..75cb00d 100644
--- a/receiver.c
+++ b/receiver.c
@@ -577,6 +577,12 @@ int recv_files(int f_in, int f_out, char *local_name)
if (DEBUG_GTE(RECV, 1))
rprintf(FINFO, "recv_files(%s)\n", fname);
+ if (daemon_filter_list.head && (*fname != '.' || fname[1] != '\0')
+ && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) {
+ rprintf(FERROR, "attempt to hack rsync failed.\n");
+ exit_cleanup(RERR_PROTOCOL);
+ }
+
#ifdef SUPPORT_XATTRS
if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers
&& !(want_xattr_optim && BITS_SET(iflags, ITEM_XNAME_FOLLOWS|ITEM_LOCAL_CHANGE)))
@@ -645,12 +651,6 @@ int recv_files(int f_in, int f_out, char *local_name)
cleanup_got_literal = 0;
- if (daemon_filter_list.head
- && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) {
- rprintf(FERROR, "attempt to hack rsync failed.\n");
- exit_cleanup(RERR_PROTOCOL);
- }
-
if (read_batch) {
int wanted = redoing
? we_want_redo(ndx)
@@ -722,7 +722,7 @@ int recv_files(int f_in, int f_out, char *local_name)
break;
}
if (!fnamecmp || (daemon_filter_list.head
- && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0)) {
+ && check_filter(&daemon_filter_list, FLOG, fnamecmp, 0) < 0)) {
fnamecmp = fname;
fnamecmp_type = FNAMECMP_FNAME;
}
diff --git a/rsync.c b/rsync.c
index b82e598..a0945ba 100644
--- a/rsync.c
+++ b/rsync.c
@@ -49,6 +49,7 @@ extern int flist_eof;
extern int file_old_total;
extern int keep_dirlinks;
extern int make_backups;
+extern int sanitize_paths;
extern struct file_list *cur_flist, *first_flist, *dir_flist;
extern struct chmod_mode_struct *daemon_chmod_modes;
#ifdef ICONV_OPTION
@@ -396,6 +397,11 @@ int read_ndx_and_attrs(int f_in, int f_out, int *iflag_ptr, uchar *type_ptr,
if (iflags & ITEM_XNAME_FOLLOWS) {
if ((len = read_vstring(f_in, buf, MAXPATHLEN)) < 0)
exit_cleanup(RERR_PROTOCOL);
+
+ if (sanitize_paths) {
+ sanitize_path(buf, buf, "", 0, SP_DEFAULT);
+ len = strlen(buf);
+ }
} else {
*buf = '\0';
len = -1;
--
The rsync repository.
More information about the rsync-cvs
mailing list