-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


On 09/12/2016 05:01 AM, Ed W wrote:
> Grr... Cut and paste error. Meant to add this is with version
> 5.0.10
> 
> 
> On 12/09/2016 12:17, Ed W wrote:
>> Hi, ref the docs here:
>> 
>> http://shorewall.net/configuration_file_basics.htm#Embedded
>> 
>> I expect to be able to slap in an INLINE perl script into the
>> accounting file with:
>> 
>> ?BEGIN PERL my $i_count = 1; foreach my $iface (qw/lan1 lan2 lan3
>> lan4/) { # rules:   ACTION           CHAIN   SOURCE
>> DESTINATION shorewall("acct_in_$i_count -       $iface    -"); 
>> $i_count++; } 1; ?END
>> 
>> 
>> However, this gives an error
>> 
>> Compiling /etc/shorewall/accounting... ERROR: Undefined
>> subroutine &Shorewall::User::shorewall called at 
>> /etc/shorewall/accounting line 21.
>> 
>> 
>> Adding "use Shorewall::Config;" resolves this
>> 
>> 
>> This code worked in some previous 4.6.13.4.  Was it supposed to?
>> The docs imply that the inline script should be autowrapped with
>> a "use Shorewall::Config;" - this would certainly save a little
>> typing?
>> 
>> Note sure if this is a change of behaviour or bug?
>> 

It's a bug introduced in 5.0.7 :-(

Patch attached.

- -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 \________________________________________________
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJX1tQsAAoJEJbms/JCOk0QLHQQAIWO6MlQ54zDZCalz90ogelU
XmOywdlaAQK8t6U5WRZNGf1Men32X2NMzws/wkBQuYIX3nypWe7/roQy5y5thrxX
hnqav//4MtIVf5BqqA2MCzq/cJW8PA0oS9prINi2jvmox9AQf5MQSEvo+0YDfUqb
07oMXRm3mQze0k/W2EIv7owbEBZYy7REbO7WLpYTtAtWdoF2h7w2zaGnrF/UsEMB
L6sHvwWEMxHn/aOmmSwCTlPqSXo9WL816FBoKKgIWObbnaDYduVF4ovJkJgFag6p
GuhQklDWCAxE43wkpwKgX8kZWQyRqmzbsCLzBpDPR97jnEY87DeoCOQSDffJq2tb
Xr3Cqbgf9cUz/I89Zfx59BSijupArE4jFIsUaRrdy2pOe5Rx6Y68ioj297SLTQIF
W2GeWzf8f5R43rJsCXRk6R5FqtnOMblkAukoZUbbdaMlr1MMM9q1SdGjZ1Vrw6lC
Umyfqx0jnWC+m1N81e1DtiB1G1wtOyPeE7RBTYBaRYFQLI7g7ItJZo+MJU6rTSdS
gkR+ZefZf0HI1xwFHdWgPZ4KpnvH4vQcQknVIpjgf3+I0NsXsKYlZHsByAcrsUlm
3BOLRoIL0pzeAtUpDljMkY+gppO8e+1kB0uJIZmHVKAAdo0/HfhrrXgOHr58hQFa
LSVJKEhbuXuE9iI7rFOV
=bH8a
-----END PGP SIGNATURE-----
diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm
index 962e06f..ad0305d 100644
--- a/Shorewall/Perl/Shorewall/Config.pm
+++ b/Shorewall/Perl/Shorewall/Config.pm
@@ -3400,7 +3400,7 @@ sub embedded_shell( $ ) {
 sub embedded_perl( $ ) {
     my $multiline = shift;
 
-    my ( $command , $linenumber ) = ( qq(package Shorewall::User;\nno strict;\n# line $currentlinenumber "$currentfilename"\n$currentline), $currentlinenumber );
+    my ( $command , $linenumber ) = ( qq(package Shorewall::User;\nno strict;\nuse Shorewall::Config (qw/shorewall/);\n# line $currentlinenumber "$currentfilename"\n$currentline), $currentlinenumber );
 
     $directive_callback->( 'PERL', $currentline ) if $directive_callback;
 

Attachment: EMBEDDED_PERL.patch.sig
Description: PGP signature

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users

Reply via email to