From: Michael Poole Date: Sun, 17 Apr 2005 14:11:04 +0000 (+0000) Subject: Improve screening for invalid input to linesync. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=4ed72369152e6a0acb93a4cef51df20857e8e8ec Improve screening for invalid input to linesync. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1367 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index e7e35ce..284179f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-04-17 Michael Poole + + * tools/linesync/linesync.sh: Fix typo comment. Check for + multiple blocks per line in the linesync input. + 2005-04-17 Dan * tools/linesync/linesync.sh: Update to support new syntax and to diff --git a/tools/linesync/linesync.sh b/tools/linesync/linesync.sh index 2720478..77330ef 100755 --- a/tools/linesync/linesync.sh +++ b/tools/linesync/linesync.sh @@ -140,7 +140,7 @@ if [ ! -s "$TMPFILE" ]; then exit 1 fi -# Check wether the file contains any disallowed .conf lines +# Check whether the file contains any disallowed .conf lines bad_lines=`egrep '^[^'$ALLOWED_LINES'|#]+' $TMPFILE` if [ ! -z "$bad_lines" ]; then echo "The file downloaded in $TMPFILE contains the following disallowed line(s):" @@ -148,6 +148,14 @@ if [ ! -z "$bad_lines" ]; then exit 1 fi +# Check whether somebody tried to sneak a second block onto some line +bad_lines=`egrep -i '}[ ]*;[ ]*[a-z]+[ ]*{' $TMPFILE` +if [ ! -z "$bad_lines" ] ; then + echo "The file downloaded in $TMPFILE contains the following multi-block line(s):" + echo $bad_lines + exit 1 +fi + # check our ircd.conf ircd_setup=`egrep '^# (BEGIN|END) LINESYNC$' $cpath|wc -l` if [ $ircd_setup != 2 ]; then