~ubuntu-branches/debian/sid/shorewall/sid

« back to all changes in this revision

Viewing changes to Perl/Shorewall/Tunnels.pm

  • Committer: Package Import Robot
  • Author(s): Roberto C. Sanchez
  • Date: 2013-05-03 08:17:42 UTC
  • mfrom: (1.3.52)
  • Revision ID: package-import@ubuntu.com-20130503081742-qo8p6k2z0dnbfqo8
Tags: 4.5.16.1-1
* New Upstream Version
* debian/patches/01_debian_configuration.patch: Refreshed
* debian/patches/02_correct_dnat_snat_behavior.patch: Removed
* Update lintian overrides

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
our @ISA = qw(Exporter);
35
35
our @EXPORT = qw( setup_tunnels );
36
36
our @EXPORT_OK = ( );
37
 
our $VERSION = '4.5_4';
 
37
our $VERSION = '4.5_11';
38
38
 
39
39
#
40
40
# Here starts the tunnel stuff -- we really should get rid of this crap...
61
61
            }
62
62
        }
63
63
 
64
 
        my @options = $globals{UNTRACKED} ? state_imatch 'NEW,UNTRACKED' : state_imatch 'NEW';
 
64
        my @options = have_capability( 'RAW_TABLE' ) ? state_imatch 'NEW,UNTRACKED' : state_imatch 'NEW';
65
65
 
66
66
        add_tunnel_rule $inchainref,  p => 50, @$source;
67
67
        add_tunnel_rule $outchainref, p => 50, @$dest;
285
285
    #
286
286
    # Setup_Tunnels() Starts Here
287
287
    #
288
 
    if ( my $fn = open_file 'tunnels' ) {
 
288
    if ( my $fn = open_file( 'tunnels', 1, 1 ) ) {
289
289
 
290
290
        first_entry "$doing $fn...";
291
291
 
292
292
        while ( read_a_line( NORMAL_READ ) ) {
293
293
 
294
 
            my ( $kind, $zone, $gateway, $gatewayzones ) = split_line1 'tunnels file', { type => 0, zone => 1, gateway => 2, gateways => 2, gateway_zone => 3 , gateway_zones => 3 }, undef, 4;
 
294
            my ( $kind, $zone, $gateway, $gatewayzones ) = split_line1 'tunnels file', { type => 0, zone => 1, gateway => 2, gateways => 2, gateway_zone => 3 , gateway_zones => 3 }, {}, 4;
295
295
 
296
296
            fatal_error 'TYPE must be specified' if $kind eq '-';
297
297
 
298
 
            if ( $kind eq 'COMMENT' ) {
299
 
                process_comment;
300
 
            } else {
301
 
                fatal_error 'ZONE must be specified' if $zone eq '-';
302
 
                setup_one_tunnel $kind, $zone, $gateway, $gatewayzones;
303
 
            }
 
298
            fatal_error 'ZONE must be specified' if $zone eq '-';
 
299
            setup_one_tunnel $kind, $zone, $gateway, $gatewayzones;
304
300
        }
305
 
 
306
 
        clear_comment;
307
301
    }
308
302
}
309
303