From 12e21f8db9b1cd1235d2638b3b031487ac3c7944 Mon Sep 17 00:00:00 2001 From: teastep Date: Fri, 3 Feb 2006 21:11:02 +0000 Subject: [PATCH] Fix GATEWAY (again) and add version checking between compiled programs and library git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3427 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/compiler | 12 ++++++++++-- Shorewall/functions | 2 ++ Shorewall/releasenotes.txt | 11 +++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Shorewall/compiler b/Shorewall/compiler index b49d583e9..06f9268c9 100755 --- a/Shorewall/compiler +++ b/Shorewall/compiler @@ -1173,6 +1173,8 @@ ${INDENT} fatal_error "Unable to detect the gateway through interface $in ${INDENT} fi __EOF__ + else + save_command "gateway=$gateway" fi if [ x${mark} != x- ]; then @@ -8439,8 +8441,14 @@ initialize() { __EOF__ if [ -z "$EXPORT" ]; then cat >&3 << __EOF__ - if [ ! -f /usr/share/shorewall/version ] || [ \$(cat /usr/share/shorewall/version) != $VERSION ]; then - startup_error "This script requires Shorewall version $VERSION" + if [ ! -f /usr/share/shorewall/version ]; then + fatal_error "This script requires Shorewall which does not appear to be installed on this system" + fi + + local version=\$(cat /usr/share/shorewall/version) + + if [ \${LIBVERSION:-0} -lt 30105 ]; then + fatal_error "This script requires Shorewall version 3.1.5 or later; current version is \$version" fi __EOF__ diff --git a/Shorewall/functions b/Shorewall/functions index 803dbe87a..e741940b8 100755 --- a/Shorewall/functions +++ b/Shorewall/functions @@ -2,6 +2,8 @@ # # Shorewall 3.2 -- /usr/share/shorewall/functions +LIBVERSION=30105 + # # Message to stderr # diff --git a/Shorewall/releasenotes.txt b/Shorewall/releasenotes.txt index 3b996f279..1db511ccc 100755 --- a/Shorewall/releasenotes.txt +++ b/Shorewall/releasenotes.txt @@ -40,6 +40,17 @@ Other changes in 3.1.5 'generate' and 'reload' command have been removed. The 'reload' command has also been removed from the program generated by 'compile'. +2) Scripts compiled without the -e option are now more forgiving when run + on systems with a different Shorewall version installed. If the + installed version meets minimum version requirements, the script will + run -- it no longer requires an exact match. + + That having been said, the minimum version required for scripts + compiled with 3.1.5 is 3.1.5. I plan to add new features to the library + (/usr/share/shorewall/functions) in advance of using them in compiled + scripts so that scripts compiled on one version of Shorewall should be + able to run on the next several newer minor releases. + Migration Considerations: 1) A number of macros have been split into two. The macros affected are: