On 1/9/11 8:09 AM, Tom Eastep wrote:
> On 1/9/11 6:44 AM, Brian J. Murrell wrote:
>> On Thu, 2011-01-06 at 14:59 -0800, Tom Eastep wrote:

> 
> The compiler could infer, though, for each member of %params whether or
> not the (param,value) was set in the params file or was part of the
> process environment. I wouldn't want the compiler to have to go through
> that for each of the user exits though, so I would make those
> assignments global to the firewall script anyway.
> 

Here's a patch for 4.4.15 and 4.4.16.

-Tom
-- 
Tom Eastep        \ When I die, I want to go like my Grandfather who
Shoreline,         \ died peacefully in his sleep. Not screaming like
Washington, USA     \ all of the passengers in his car
http://shorewall.net \________________________________________________
diff --git a/Shorewall/Perl/Shorewall/Compiler.pm 
b/Shorewall/Perl/Shorewall/Compiler.pm
index be4c16b..cfd7da3 100644
--- a/Shorewall/Perl/Shorewall/Compiler.pm
+++ b/Shorewall/Perl/Shorewall/Compiler.pm
@@ -229,7 +229,18 @@ sub generate_script_2() {
 
     set_chain_variables;
 
-    append_file 'params' if $config{EXPORTPARAMS};
+    if ( $config{EXPORTPARAMS} ) {
+       append_file 'params';
+    } else {
+       while ( my ( $param, $value ) = each %params ) {
+           next if $param =~ /^(?:root|system|files|destination)$/;
+           if ( exists $ENV{$param} && defined $ENV{$param} ) {
+               next if $value eq $ENV{$param};
+           }
+           
+           emit "$param='$value'";
+       }
+    }
 
     emit ( '',
           "g_stopping=",

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users

Reply via email to