From 48e8e1b94f253c21696e6f3200871722ced00370eb20fa9ebfdc62470e196600 Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Mon, 23 Apr 2012 11:14:02 +0000 Subject: [PATCH] - Force debug output off completely when running under xinetd (fixes protocol breakage when target directories don't exist; bnc#752563) OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/csync2?expand=0&rev=13 --- csync2.changes | 6 ++++++ csync2.spec | 2 ++ force-debug-stderr-off-inetd.patch | 21 +++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 force-debug-stderr-off-inetd.patch diff --git a/csync2.changes b/csync2.changes index 89fe291..5ef797a 100644 --- a/csync2.changes +++ b/csync2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Mar 19 12:51:03 UTC 2012 - tserong@suse.com + +- Force debug output off completely when running under xinetd (fixes + protocol breakage when target directories don't exist; bnc#752563) + ------------------------------------------------------------------- Mon Feb 20 19:10:40 UTC 2012 - coolo@suse.com diff --git a/csync2.spec b/csync2.spec index 4b85e05..53e6682 100644 --- a/csync2.spec +++ b/csync2.spec @@ -33,6 +33,7 @@ Patch1: fix-missing-sentinels.diff Patch2: csync2-1.34-pure-gnutls-r2.patch BuildRequires: pkg-config %endif +Patch3: force-debug-stderr-off-inetd.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires(post): openssl Requires: gnutls @@ -64,6 +65,7 @@ and server farms. %if 0%{?suse_version} > 1120 %patch2 -p1 %endif +%patch3 -p1 install -p -m 644 %{SOURCE1} README.quickstart %build diff --git a/force-debug-stderr-off-inetd.patch b/force-debug-stderr-off-inetd.patch new file mode 100644 index 0000000..b0ee06d --- /dev/null +++ b/force-debug-stderr-off-inetd.patch @@ -0,0 +1,21 @@ +Index: csync2-1.34/csync2.c +=================================================================== +--- csync2-1.34.orig/csync2.c ++++ csync2-1.34/csync2.c +@@ -458,6 +458,16 @@ int main(int argc, char ** argv) + for (i=0; myhostname[i]; i++) + myhostname[i] = tolower(myhostname[i]); + ++ if ( mode == MODE_INETD ) { ++ /* Force debug level below zero when running under inetd, ++ * else stderr junk may be emitted back to some other host ++ * which breaks the protocol. One case is where a target ++ * directory does not exist resulting in allegations of ++ * I/O error during rsync write (bnc#752563) ++ */ ++ csync_debug_level = -1; ++ } ++ + /* Stand-alone server mode. This is a hack.. + */ + if ( mode == MODE_SERVER || mode == MODE_SINGLE ) {