From 8e31ce86b369f954220ad9bdf0f2ebe80b3cf00b Mon Sep 17 00:00:00 2001 From: Guillaume Rousse Date: Mon, 5 Mar 2007 16:15:36 +0000 Subject: only scan local facilities from 0 to 7 (fix #29141) --- get-free-syslog-facility | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/get-free-syslog-facility b/get-free-syslog-facility index 8524844..192e0e4 100755 --- a/get-free-syslog-facility +++ b/get-free-syslog-facility @@ -3,9 +3,10 @@ # helper script for rpm scriptlets to get a free syslog local facility if [ -f /etc/syslog.conf ]; then - cntlog=0 - while grep -q local${cntlog} /etc/syslog.conf; do - cntlog=$((cntlog+1)); + for (( i=0; i <= 7; i++ )); do + if ! grep -q "local$i" /etc/syslog.conf; then + echo "local$i" + break + fi done - echo local${cntlog} fi -- cgit v1.2.1