1 This makes the default for a protocol-28 server process be --stderr=client
2 instead of --stderr=errors. See rsync's github issue 95.
4 To use this patch, run these commands for a successful build:
6 patch -p1 <patches/stderr-compat.diff
7 ./configure (optional if already run)
10 based-on: 58f464f4daa1b1ee00c6afd898a19ca5cd81bf58
11 diff --git a/NEWS.md b/NEWS.md
15 where the INFO is one of "type change", "sum change" (requires `-c`), "file
16 change" (based on the quick check), "attr change", or "uptodate".
18 + - Try to support a client that sent a remote rsync a wacko stderr file handle
19 + (such as an older File::RsyncP perl library).
21 - Some manpage improvements.
23 ### PACKAGING RELATED:
24 diff --git a/compat.c b/compat.c
27 @@ -52,6 +52,8 @@ extern int need_messages_from_generator;
28 extern int delete_mode, delete_before, delete_during, delete_after;
29 extern int do_compression;
30 extern int do_compression_level;
31 +extern int saw_stderr_opt;
32 +extern int msgs2stderr;
33 extern char *shell_cmd;
34 extern char *partial_dir;
35 extern char *files_from;
36 @@ -622,6 +624,9 @@ void setup_protocol(int f_out,int f_in)
40 + if (!saw_stderr_opt && protocol_version <= 28 && am_server)
41 + msgs2stderr = 0; /* The client side may not have stderr setup for us. */
43 #ifndef SUPPORT_PREALLOCATION
44 if (preallocate_files && !am_sender) {
45 rprintf(FERROR, "preallocation is not supported on this %s\n",
46 diff --git a/options.c b/options.c
49 @@ -88,6 +88,7 @@ int implied_dirs = 1;
50 int missing_args = 0; /* 0 = FERROR_XFER, 1 = ignore, 2 = delete */
52 int msgs2stderr = 2; /* Default: send errors to stderr for local & remote-shell transfers */
53 +int saw_stderr_opt = 0;
54 int allow_8bit_chars = 0;
57 @@ -1875,6 +1876,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
58 "--stderr mode \"%s\" is not one of errors, all, or client\n", arg);
65 @@ -1893,6 +1895,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
69 + if (msgs2stderr != 2)
72 if (version_opt_cnt) {
73 print_rsync_version(FINFO);