Blob Blame History Raw
From 1d9d43713db58f6aafab6c0692fc2ebb9a26b4c7 Mon Sep 17 00:00:00 2001
From: Brendan Germain <brendan.germain@nasdaqomx.com>
Date: Wed, 25 May 2016 16:11:11 -0400
Subject: [PATCH] subshell and set -f to prevent expansion

---
 modules.d/98syslog/rsyslogd-start.sh | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules.d/98syslog/rsyslogd-start.sh b/modules.d/98syslog/rsyslogd-start.sh
index 08b6fb2..c64f212 100755
--- a/modules.d/98syslog/rsyslogd-start.sh
+++ b/modules.d/98syslog/rsyslogd-start.sh
@@ -20,9 +20,14 @@ rsyslog_config() {
 
     cat $syslog_template
 
-    for filter in $filters; do
-        echo "${filter} @${server}"
-    done
+    (
+        # disable shell expansion / globbing
+        # since filters contain such characters
+        set -f
+        for filter in $filters; do
+            echo "${filter} @${server}"
+        done
+    )
     #echo "*.* /tmp/syslog"
 }