From 36798db53e111a2196e7ae16dcfc6abe993a1948 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Tue, 25 Mar 2014 13:30:03 +0100 Subject: [PATCH] MT#5715 use locking before write to fifo --- debian/patches/fix_MT5715.patch | 20 ++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 21 insertions(+) create mode 100644 debian/patches/fix_MT5715.patch diff --git a/debian/patches/fix_MT5715.patch b/debian/patches/fix_MT5715.patch new file mode 100644 index 0000000..77a2407 --- /dev/null +++ b/debian/patches/fix_MT5715.patch @@ -0,0 +1,20 @@ +--- a/heartbeat/shellfuncs.in ++++ b/heartbeat/shellfuncs.in +@@ -113,10 +113,16 @@ + # o Using "cat -" rather than "cat" simply for clarity. + # o The trailing "| cat -" tries to hold things together as a single + # write (which is probably preferable behaviour in this context). ++# ++# use a lockfile to be sure + ha_clustermsg() { +- (echo ">>>"; cat -; echo "<<<") | cat - >> $HA_FIFO ++ ( ++ flock -x -w 2 9 || exit 1; ++ (echo ">>>"; cat -; echo "<<<";)| cat - >> $HA_FIFO ++ ) 9>/tmp/clustermsg.lock + } + ++ + ha_parameter() { + VALUE=`sed -e 's%[ ][ ]*% %' -e 's%^ %%' -e 's%#.*%%' $HA_CF | + grep -i "^$1 " | sed 's%[^ ]* %%'` diff --git a/debian/patches/series b/debian/patches/series index e96f2c1..0e32a8b 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -15,3 +15,4 @@ IPv6addr-64.patch o2cb-INITDIR.patch IPv6addr-background-UA.patch cherry-pick-upstream-de3074ce2c9718725a374bcd2199ebc.patch +fix_MT5715.patch