From eac752894c7828f36b51bfe9eee882f10774cc7c Mon Sep 17 00:00:00 2001 From: kuriyama Date: Sun, 17 Jan 2010 00:20:11 +0000 Subject: - Upgrade to 3.2.3. Approved by: maintainer --- security/swatch/Makefile | 3 +- security/swatch/distinfo | 6 +- security/swatch/files/patch-Throttle.pm | 87 ++++++++++++++++++++++ security/swatch/files/patch-swatch | 11 --- security/swatch/files/patch-swatch-2 | 126 -------------------------------- 5 files changed, 91 insertions(+), 142 deletions(-) create mode 100644 security/swatch/files/patch-Throttle.pm delete mode 100644 security/swatch/files/patch-swatch delete mode 100644 security/swatch/files/patch-swatch-2 (limited to 'security/swatch') diff --git a/security/swatch/Makefile b/security/swatch/Makefile index 485012c32eaa..c461a3a95e89 100644 --- a/security/swatch/Makefile +++ b/security/swatch/Makefile @@ -6,8 +6,7 @@ # PORTNAME= swatch -PORTVERSION= 3.2.1 -PORTREVISION= 2 +PORTVERSION= 3.2.3 CATEGORIES= security sysutils MASTER_SITES= SF diff --git a/security/swatch/distinfo b/security/swatch/distinfo index 52e220bdcf28..1786ff70d671 100644 --- a/security/swatch/distinfo +++ b/security/swatch/distinfo @@ -1,3 +1,3 @@ -MD5 (swatch-3.2.1.tar.gz) = e55db93ef6250d684a56104fd03b8821 -SHA256 (swatch-3.2.1.tar.gz) = 9f05c0f051505d7eafd9170942129ebcec89521c68c1f0e349c43d01a89a9aeb -SIZE (swatch-3.2.1.tar.gz) = 31039 +MD5 (swatch-3.2.3.tar.gz) = 1162f1024cf07fc750ed4960d61ac4e8 +SHA256 (swatch-3.2.3.tar.gz) = e29480993e52f245f3abec079b3103d8e97244dafe754f8c2d37e7b0b3b58077 +SIZE (swatch-3.2.3.tar.gz) = 31199 diff --git a/security/swatch/files/patch-Throttle.pm b/security/swatch/files/patch-Throttle.pm new file mode 100644 index 000000000000..b3a7ffef356a --- /dev/null +++ b/security/swatch/files/patch-Throttle.pm @@ -0,0 +1,87 @@ +--- lib/Swatch/Throttle.pm.orig 2010-01-16 00:54:35.478307464 +0900 ++++ lib/Swatch/Throttle.pm 2010-01-16 00:58:31.814303601 +0900 +@@ -95,6 +95,7 @@ + @_ + ); + ++ my @delay = split(/:/, "0:$opts{DELAY}"); + my @dmyhms; + my $key; + my $cur_rec; +@@ -134,30 +135,61 @@ + $rec->{FIRST} = [ @dmyhms ]; + $rec->{LAST} = [ @dmyhms ]; + $rec->{HOLD_DHMS} = $opts{HOLD_DHMS} if defined $opts{HOLD_DHMS}; +- $rec->{COUNT} = 1; ++ $rec->{COUNT} = 0; + $LogRecords{$key} = $rec; +- return $msg; +- } else { +- $cur_rec = $LogRecords{$key}; +- $cur_rec->{COUNT}++; +- if (defined $opts{THRESHOLD} and $cur_rec->{COUNT} == $opts{THRESHOLD}) { +- ## threshold exceeded ## +- chomp $msg; +- $msg = "$msg (threshold $opts{THRESHOLD} exceeded)"; +- $cur_rec->{COUNT} = 0; +- } elsif (defined $opts{HOLD_DHMS} +- and past_hold_time($cur_rec->{LAST}, +- \@dmyhms, $opts{HOLD_DHMS})) { ++ } ++ ++ ## Get current record ## ++ $cur_rec = $LogRecords{$key}; ++ $cur_rec->{COUNT}++; ++ ++ ## delay only ## ++ if( defined $opts{DELAY} and not defined $opts{THRESHOLD} ) { ++ if( past_hold_time($cur_rec->{LAST}, [ @dmyhms ], [ @delay ]) ) { + ## hold time exceeded ## + chomp $msg; + $msg = "$msg (seen $cur_rec->{COUNT} times)"; +- $cur_rec->{COUNT} = 0; ++ $cur_rec->{COUNT} = 1; + $cur_rec->{LAST} = [ @dmyhms ]; + } else { + $msg = ''; + } +- $LogRecords{$key} = $cur_rec if exists($LogRecords{$key}); ## save any new values ## ++ ++ ## threshold only ## ++ } elsif( defined $opts{THRESHOLD} and not defined $opts{DELAY} ) { ++ if( $cur_rec->{COUNT} == $opts{THRESHOLD}) { ++ ## threshold exceeded ## ++ chomp $msg; ++ $msg = "$msg (threshold $opts{THRESHOLD} exceeded)"; ++ $cur_rec->{COUNT} = 0; ++ } else { ++ $msg = ''; ++ } ++ ++ ## threshold AND delay ## ++ } elsif( defined $opts{THRESHOLD} and defined $opts{DELAY} ) { ++ if( not past_hold_time($cur_rec->{LAST}, [ @dmyhms ], [ @delay ]) ) { ++ if( $cur_rec->{COUNT} == $opts{THRESHOLD} ) { ++ ## threshold exceeded during delay ## ++ chomp $msg; ++ $msg = "$msg (threshold $opts{THRESHOLD} exceeded during delay $opts{DELAY})"; ++ ++ ## TODO: Tenir compte du parametre repeat ici ## ++ $cur_rec->{COUNT} = 0; ++ $cur_rec->{LAST} = [ @dmyhms ]; ++ } else { ++ $msg = ''; ++ } ++ } else { ++ $cur_rec->{COUNT} = 1; ++ $cur_rec->{LAST} = [ @dmyhms ]; ++ $msg = ''; ++ } + } ++ ++ ## save any new values ## ++ $LogRecords{$key} = $cur_rec if exists($LogRecords{$key}); ++ + return $msg; + } + diff --git a/security/swatch/files/patch-swatch b/security/swatch/files/patch-swatch deleted file mode 100644 index 9b10f78e15f7..000000000000 --- a/security/swatch/files/patch-swatch +++ /dev/null @@ -1,11 +0,0 @@ ---- swatch.orig Fri Nov 5 12:06:30 2004 -+++ swatch Fri Nov 5 12:06:46 2004 -@@ -396,7 +396,7 @@ - my $Now = 0; # The current time in Unix seconds. Gets set when set_restart_time is called - my $thCounter = 0; - my $tail_cmd_name = ''; # We'll try to find it in the PATH later --my $tail_cmd_args = '-n 0 -f'; -+my $tail_cmd_args = '-n 0 -F'; - $awk_field_syntax = 0; - - my $USAGE = qq/ diff --git a/security/swatch/files/patch-swatch-2 b/security/swatch/files/patch-swatch-2 deleted file mode 100644 index 648d951ca6fa..000000000000 --- a/security/swatch/files/patch-swatch-2 +++ /dev/null @@ -1,126 +0,0 @@ ---- swatch.orig 2006-07-21 14:55:00.000000000 -0600 -+++ swatch 2006-08-24 17:02:03.000000000 -0600 -@@ -404,12 +404,16 @@ - \$/ = "$opt_input_record_separator"; - my \$swatch_flush_interval = 300; - my \$swatch_last_flush = time; -+my \$tail_pid = -1; - - use IO::Handle; - STDOUT->autoflush(1); - - sub goodbye { - \$| = 0; -+ if( \$tail_pid != -1 ) { -+ kill('TERM', \$tail_pid); -+ } - ]; - - if ($opt_read_pipe) { -@@ -517,7 +521,8 @@ - } - $code = qq/ - my \$filename = '$filename'; --if (not open(TAIL, \"$tail_cmd_name $tail_cmd_args \$filename|\")) { -+\$tail_pid = open(TAIL, \"$tail_cmd_name $tail_cmd_args \$filename|\"); -+if (not \$tail_pid) { - die "$0: cannot read run \\"$tail_cmd_name $tail_cmd_args \$filename\\": \$!\\n"; - } - -@@ -543,6 +548,7 @@ - my $code; - $code = q[ - } -+## TODO: Add close !!! - ]; - return $code; - } ---- lib/Swatch/Throttle.pm.orig 2004-07-19 22:14:54.000000000 +0200 -+++ lib/Swatch/Throttle.pm 2006-01-02 17:06:14.000000000 +0100 -@@ -95,6 +95,7 @@ - @_ - ); - -+ my @delay = split(/:/, "0:$opts{DELAY}"); - my @dmyhms; - my $key; - my $cur_rec; -@@ -134,30 +135,61 @@ - $rec->{FIRST} = [ @dmyhms ]; - $rec->{LAST} = [ @dmyhms ]; - $rec->{HOLD_DHMS} = $opts{HOLD_DHMS} if defined $opts{HOLD_DHMS}; -- $rec->{COUNT} = 1; -+ $rec->{COUNT} = 0; - $LogRecords{$key} = $rec; -- return $msg; -- } else { -- $cur_rec = $LogRecords{$key}; -- $cur_rec->{COUNT}++; -- if (defined $opts{THRESHOLD} and $cur_rec->{COUNT} == $opts{THRESHOLD}) { -- ## threshold exceeded ## -- chomp $msg; -- $msg = "$msg (threshold $opts{THRESHOLD} exceeded)"; -- $cur_rec->{COUNT} = 0; -- } elsif (defined $opts{HOLD_DHMS} -- and past_hold_time($cur_rec->{LAST}, -- \@dmyhms, $opts{HOLD_DHMS})) { -+ } -+ -+ ## Get current record ## -+ $cur_rec = $LogRecords{$key}; -+ $cur_rec->{COUNT}++; -+ -+ ## delay only ## -+ if( defined $opts{DELAY} and not defined $opts{THRESHOLD} ) { -+ if( past_hold_time($cur_rec->{LAST}, [ @dmyhms ], [ @delay ]) ) { - ## hold time exceeded ## - chomp $msg; - $msg = "$msg (seen $cur_rec->{COUNT} times)"; -- $cur_rec->{COUNT} = 0; -+ $cur_rec->{COUNT} = 1; - $cur_rec->{LAST} = [ @dmyhms ]; - } else { - $msg = ''; - } -- $LogRecords{$key} = $cur_rec if exists($LogRecords{$key}); ## save any new values ## -+ -+ ## threshold only ## -+ } elsif( defined $opts{THRESHOLD} and not defined $opts{DELAY} ) { -+ if( $cur_rec->{COUNT} == $opts{THRESHOLD}) { -+ ## threshold exceeded ## -+ chomp $msg; -+ $msg = "$msg (threshold $opts{THRESHOLD} exceeded)"; -+ $cur_rec->{COUNT} = 0; -+ } else { -+ $msg = ''; -+ } -+ -+ ## threshold AND delay ## -+ } elsif( defined $opts{THRESHOLD} and defined $opts{DELAY} ) { -+ if( not past_hold_time($cur_rec->{LAST}, [ @dmyhms ], [ @delay ]) ) { -+ if( $cur_rec->{COUNT} == $opts{THRESHOLD} ) { -+ ## threshold exceeded during delay ## -+ chomp $msg; -+ $msg = "$msg (threshold $opts{THRESHOLD} exceeded during delay $opts{DELAY})"; -+ -+ ## TODO: Tenir compte du parametre repeat ici ## -+ $cur_rec->{COUNT} = 0; -+ $cur_rec->{LAST} = [ @dmyhms ]; -+ } else { -+ $msg = ''; -+ } -+ } else { -+ $cur_rec->{COUNT} = 1; -+ $cur_rec->{LAST} = [ @dmyhms ]; -+ $msg = ''; -+ } - } -+ -+ ## save any new values ## -+ $LogRecords{$key} = $cur_rec if exists($LogRecords{$key}); -+ - return $msg; - } - - - -- cgit