SHA256
1
0
forked from pool/rsync
rsync/rsync-send_error_to_sender.patch
Tomáš Chvátal cd1cb5dfdb Accepting request 570556 from home:pmonrealgonzalez:branches:network
- Update to version 3.1.3 [bsc#1076503]:
  Protocol: 31 (unchanged)
- SECURITY FIXES:
  * Fixed a buffer overrun in the protocol's handling of xattr names and
    ensure that the received name is null terminated.
  * Fix an issue with --protect-args where the user could specify the arg
    in the protected-arg list and short-circuit some of the arg-sanitizing
    code.
- BUG FIXES:
  * Don't output about a new backup dir without appropriate info verbosity.
  * Fixed some issues with the sort functions in support/rsyncstats script.
  * Added a way to specify daemon config lists (e.g. users, groups, etc)
  * that contain spaces (see "auth users" in the latest rsyncd.conf manpage).
  * If a backup fails (e.g. full disk) rsync exits with an error.
  * Fixed a problem with a doubled --fuzzy option combined with --link-dest.
  * Avoid invalid output in the summary if either the start or end time had
    an error.
  * We don't allow a popt alias to affect the --daemon or --server options.
  * Fix daemon exclude code to disallow attribute changes in addition to
    disallowing transfers.
  * Don't force nanoseconds to match if a non-transferred, non-checksummed
    file only passed the quick-check w/o comparing nanosecods.
- ENHANCEMENTS:
  * Added the ability for rsync to compare nanosecond times in its
    file-check
    comparisons, and added support nanosecond times on Mac OS X.
  * Added a short-option (-@) for --modify-window.
  * Added the --checksum-choice=NAME[,NAME] option to choose the checksum
    algorithms.
  * Added hashing of xattr names (with using -X) to improve the handling of

OBS-URL: https://build.opensuse.org/request/show/570556
OBS-URL: https://build.opensuse.org/package/show/network/rsync?expand=0&rev=67
2018-01-29 11:31:12 +00:00

74 lines
2.5 KiB
Diff

https://bugzilla.samba.org/show_bug.cgi?id=12522#c2
Index: rsync.h
===================================================================
--- rsync.h.orig
+++ rsync.h
@@ -167,6 +167,7 @@
#define ATTRS_SKIP_MTIME (1<<1)
#define ATTRS_SET_NANO (1<<2)
+#define MSG_FLUSH 2
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
Index: io.c
===================================================================
--- io.c.orig
+++ io.c
@@ -1994,10 +1994,11 @@ static void sleep_for_bwlimit(int bytes_
void io_flush(int flush_it_all)
{
if (iobuf.out.len > iobuf.out_empty_len) {
- if (flush_it_all) /* FULL_FLUSH: flush everything in the output buffers */
+ if (flush_it_all == FULL_FLUSH) /* flush everything in the output buffers */
perform_io(iobuf.out.size - iobuf.out_empty_len, PIO_NEED_OUTROOM);
- else /* NORMAL_FLUSH: flush at least 1 byte */
+ else if (flush_it_all == NORMAL_FLUSH) /* flush at least 1 byte */
perform_io(iobuf.out.size - iobuf.out.len + 1, PIO_NEED_OUTROOM);
+ /* MSG_FLUSH: flush iobuf.msg only */
}
if (iobuf.msg.len)
perform_io(iobuf.msg.size, PIO_NEED_MSGROOM);
Index: cleanup.c
===================================================================
--- cleanup.c.orig
+++ cleanup.c
@@ -26,6 +26,7 @@ extern int dry_run;
extern int am_server;
extern int am_daemon;
extern int am_receiver;
+extern int am_sender;
extern int io_error;
extern int keep_partial;
extern int got_xfer_error;
@@ -243,15 +244,21 @@ NORETURN void _exit_cleanup(int code, co
switch_step++;
if (exit_code && exit_code != RERR_SOCKETIO && exit_code != RERR_STREAMIO && exit_code != RERR_SIGNAL1
- && exit_code != RERR_TIMEOUT && !shutting_down && (protocol_version >= 31 || am_receiver)) {
- if (line > 0) {
- if (DEBUG_GTE(EXIT, 3)) {
- rprintf(FINFO, "[%s] sending MSG_ERROR_EXIT with exit_code %d\n",
- who_am_i(), exit_code);
+ && exit_code != RERR_TIMEOUT && !shutting_down) {
+ if (protocol_version >= 31 || am_receiver) {
+ if (line > 0) {
+ if (DEBUG_GTE(EXIT, 3)) {
+ rprintf(FINFO, "[%s] sending MSG_ERROR_EXIT with exit_code %d\n",
+ who_am_i(), exit_code);
+ }
+ send_msg_int(MSG_ERROR_EXIT, exit_code);
}
- send_msg_int(MSG_ERROR_EXIT, exit_code);
+ if (!am_sender)
+ io_flush(MSG_FLUSH); /* Be sure to send all messages */
+ noop_io_until_death();
}
- noop_io_until_death();
+ else if (!am_sender)
+ io_flush(MSG_FLUSH); /* Be sure to send all messages */
}
/* FALLTHROUGH */