Blob Blame History Raw
From 9db6e28d381b19f2a396ea1a0f06ae4d434c0a27 Mon Sep 17 00:00:00 2001
From: Marek 'marx' Grac <mgrac@redhat.com>
Date: Thu, 27 Nov 2014 13:36:16 +0100
Subject: [PATCH 1/3] [fencing] Character \x00 can't be inside syslog message

---
 fence/agents/lib/fencing.py.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 740a4e0..302bba2 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -1215,5 +1215,7 @@ class SyslogLibHandler(logging.StreamHandler):
 		}[record.levelno]
 
 		msg = self.format(record)
-		syslog.syslog(syslog_level, msg)
+
+		# syslos.syslog can not have 0x00 character inside or exception is thrown
+		syslog.syslog(syslog_level, msg.replace("\x00","\n"))
 		return
-- 
1.9.3