I’m wondering if this is the best way to stop RTIR from detecting CIDR
ranges. I’ve been looking
into /opt/rt4/local/plugins/RT-IR/lib/RT/Action/RTIR_FindIP.pm and modified
the following section:
elsif ( $4 && defined $5 ) { # IPv4/mask
next; # Do not add IPv4 ranges to tickets*
my $cidr = join( '.', map $_||0, (split /\./, $4)[0..3] )
."/$5";
my $range = (Net::CIDR::cidr2range( $cidr ))[0] or next;
$spots_left -= $self->AddIP(
IP => $range, CustomField => $cf, Skip => %existing
);
}
Is this the best way? Or is there something else I should have done
instead?
I’m wondering if this is the best way to stop RTIR from detecting CIDR ranges. I’ve been
looking into /opt/rt4/local/plugins/RT-IR/lib/RT/Action/RTIR_FindIP.pm and modified the
following section:
elsif ( $4 && defined $5 ) { # IPv4/mask
next; # Do not add IPv4 ranges to tickets
my $cidr = join( ‘.’, map $_||0, (split /./, $4)[0…3] ) ."/$5";
my $range = (Net::CIDR::cidr2range( $cidr ))[0] or next;
$spots_left -= $self->AddIP(
IP => $range, CustomField => $cf, Skip => %existing
);
}
Is this the best way? Or is there something else I should have done instead?
It’s almost impossible for me to parse your changes since the
whitespace has been completely lost.
Can you instead post a unified diff (diff -u) of your change?
Also, if you’re going to change RT/extension code, you should be using
local/lib instead of hacking in place. Otherwise upgrading will be…
fun.
next; # Do not add IPv4 ranges to tickets
my $cidr = join( '.', map $_||0, (split /\./, $4)[0..3] )
."/$5";
my $range = (Net::CIDR::cidr2range( $cidr ))[0] or next;
$spots_left -= $self->AddIP(
In this case where would this modified RTIR_FindIP.pm go and properly
supersede the original? /opt/rt4/local/lib or
/opt/rt4/local/plugins/RT-IR/local/lib?On 28 May 2013 13:49, Kevin Falcone falcone@bestpractical.com wrote:
On Fri, May 24, 2013 at 02:11:58PM -0700, Landon wrote:
I’m wondering if this is the best way to stop RTIR from detecting
CIDR ranges. I’ve been
looking into
/opt/rt4/local/plugins/RT-IR/lib/RT/Action/RTIR_FindIP.pm and modified the
following section:
elsif ( $4 && defined $5 ) { # IPv4/mask
next; # Do not add IPv4 ranges to tickets
my $cidr = join( ‘.’, map $_||0, (split /./, $4)[0…3] ) ."/$5";
my $range = (Net::CIDR::cidr2range( $cidr ))[0] or next;
$spots_left -= $self->AddIP(
IP => $range, CustomField => $cf, Skip => %existing
);
}
Is this the best way? Or is there something else I should have done
instead?
It’s almost impossible for me to parse your changes since the
whitespace has been completely lost.
Can you instead post a unified diff (diff -u) of your change?
Also, if you’re going to change RT/extension code, you should be using
local/lib instead of hacking in place. Otherwise upgrading will be…
fun.
Landon Stewart :: lstewart@iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité http://iweb.com :: +1 (888) 909-4932