Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Feb 2007 21:06:47 +0100 (CET)
From:      Ralf van der Enden <tremere@cainites.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/109370: security/swatch: update to 3.2.1
Message-ID:  <20070220200647.06FF5122@mail.cainites.net>
Resent-Message-ID: <200702202010.l1KKA5ue081599@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         109370
>Category:       ports
>Synopsis:       security/swatch: update to 3.2.1
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 20 20:10:04 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Ralf van der Enden
>Release:        FreeBSD 6.2-RELEASE-p1 i386
>Organization:
>Environment:
System: FreeBSD lan.cainites.net 6.2-RELEASE-p1 FreeBSD 6.2-RELEASE-p1 #1: Sat Feb 10 10:33:32 CET 2007 root@lan.cainites.net:/usr/obj/usr/src/sys/HELLKERNEL i386


	
>Description:
Update to swatch 3.2.1
Include threshold and exit patch from sourceforge site
>How-To-Repeat:
	
>Fix:

	

--- swatch-3.2.1.diff begins here ---
diff -ruN swatch/Makefile swatch.new/Makefile
--- swatch/Makefile	Wed Nov 17 02:42:53 2004
+++ swatch.new/Makefile	Sun Feb 18 20:31:40 2007
@@ -6,8 +6,7 @@
 #
 
 PORTNAME=	swatch
-PORTVERSION=	3.1.1
-PORTREVISION=	1
+PORTVERSION=	3.2.1
 CATEGORIES=	security sysutils
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	swatch
diff -ruN swatch/distinfo swatch.new/distinfo
--- swatch/distinfo	Tue Jan 24 02:03:30 2006
+++ swatch.new/distinfo	Sun Feb 18 20:31:45 2007
@@ -1,3 +1,3 @@
-MD5 (swatch-3.1.1.tar.gz) = fe38cc8d073e692a7426693837c3749d
-SHA256 (swatch-3.1.1.tar.gz) = e6874cc6d8441d0a4c065c625ab04b2d19c7aff7b83ce5f2260d2c2ccea3f903
-SIZE (swatch-3.1.1.tar.gz) = 29568
+MD5 (swatch-3.2.1.tar.gz) = e55db93ef6250d684a56104fd03b8821
+SHA256 (swatch-3.2.1.tar.gz) = 9f05c0f051505d7eafd9170942129ebcec89521c68c1f0e349c43d01a89a9aeb
+SIZE (swatch-3.2.1.tar.gz) = 31039
diff -ruN swatch/files/patch-swatch-2 swatch.new/files/patch-swatch-2
--- swatch/files/patch-swatch-2	Thu Jan  1 01:00:00 1970
+++ swatch.new/files/patch-swatch-2	Mon Feb 19 09:49:23 2007
@@ -0,0 +1,126 @@
+--- 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;
+ }
+ 
+
+ 	  	 
--- swatch-3.2.1.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070220200647.06FF5122>