Bug#581261: iwatch: not all listed event types to alert on actually do anything...eg modify, attrib etc

2011-02-16 Thread Michael Prokop
tag 581261 + patch
tag 608843 + patch
forwarded 608843 ca...@gmx.at
forwarded 611996 ca...@gmx.at
forwarded 494397 ca...@gmx.at
thanks

* Brendan Beveridge brendan.beveri...@interspire.com [Die Mai 11, 2010 at 
11:19:39 -0500]:

 not all listed event types to alert on actually do anything...eg modify, 
 attrib etc

 Theyre are listed in the code and and have configuration options for them.

 The code simply doesnt look at the extra options.
 I have written a patch which takes care of most of the missing ones.

 I've also checked the latest version upstream which also is missing the 
 requried code

Cahya, any news from your side?

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581261 is still
open, as well as:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608843
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=611996
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=494397

and for all of them I'd need your feedback and help.

Are you still doing development / maintenance of iwatch or should
iwatch be considered orphaned by you (which would be sad!)?

regards,
-mika-


signature.asc
Description: Digital signature


Bug#581261: iwatch: not all listed event types to alert on actually do anything...eg modify, attrib etc

2010-05-11 Thread Brendan Beveridge
Package: iwatch
Version: 0.2.1-3
Severity: important


not all listed event types to alert on actually do anything...eg modify, attrib 
etc

Theyre are listed in the code and and have configuration options for them.

The code simply doesnt look at the extra options.
I have written a patch which takes care of most of the missing ones.

I've also checked the latest version upstream which also is missing the 
requried code



-- System Information:
Debian Release: 5.0.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages iwatch depends on:
ii  libevent-perl1.11-1  Generic Perl event loop
ii  liblinux-inotify2-perl   1:1.1-2.1+b1scalable directory/file change not
ii  libmail-sendmail-perl0.79-5  Send email from a perl script
ii  libxml-simpleobject-libx 0.53-1  Simple oo representation of an XML
ii  perl-modules 5.10.0-19lenny2 Core Perl modules
ii  postfix [mail-transport- 2.5.5-1.1   High-performance mail transport ag

iwatch recommends no packages.

iwatch suggests no packages.

-- no debconf information
--- ../iwatch-current/iwatch2010-05-11 23:02:51.0 -0500
+++ ./iwatch2010-05-11 22:56:14.0 -0500
@@ -74,7 +74,7 @@ my %InotifyEvents = (
   'isdir' = IN_ISDIR,
   'oneshot' = IN_ONESHOT,
   'all_events' = IN_ALL_EVENTS,
-  'default' = 
IN_CLOSE_WRITE|IN_CREATE|IN_DELETE|IN_MOVE|IN_DELETE_SELF|IN_MOVE_SELF,
+  'default' = 
IN_ATTRIB|IN_MODIFY|IN_CLOSE_WRITE|IN_CREATE|IN_DELETE|IN_MOVE|IN_DELETE_SELF|IN_MOVE_SELF,
 );
 my %InotifyEventNames;
 foreach my $EventName (keys %InotifyEvents) {
@@ -334,15 +334,50 @@ sub mywatch {
 syslog(info,$Message) if($Path-{'syslog'});
   }
   if($e-IN_CREATE  -d $Filename  $Path-{'type'} eq recursive) {
-print STDERR [$now] * Directory $Filename is watched\n if($VERBOSE0);
-syslog(info,* Directory $Filename is watched) if($Path-{'syslog'});
-print STDERR Can't watch $Filename: $!\n
-  if(!$inotify-watch ($Filename, $Path-{'mask'}, \mywatch));
+if (-d $Filename  $Path-{'type'} eq recursive) {
+print STDERR [$now] * Directory $Filename is watched\n 
if($VERBOSE0);
+syslog(info,* Directory $Filename is watched) 
if($Path-{'syslog'});
+print STDERR Can't watch $Filename: $!\n if(!$inotify-watch 
($Filename, $Path-{'mask'}, \mywatch));
+}
+elsif ($Path-{'type'} eq recursive) {
+$localMessage = * $Filename created\n;
+$Message = $Message\n$localMessage;
+$Mail{Subject} = [$PROGRAM]  . hostname() . : $Filename created;  
+print STDERR [$now] $localMessage if($VERBOSE0);
+syslog(info,$localMessage) if($Path-{'syslog'});
+}
+$localMessage = * $Filename opened for writing closed\n;
+$Message = $Message\n$localMessage;
+$Mail{Subject} = [$PROGRAM]  . hostname() . : $Filename opened for 
writing closed;  
+print STDERR [$now] $localMessage if($VERBOSE0);
+syslog(info,$localMessage) if($Path-{'syslog'});
+
+  }
+  elsif($e-IN_ACCESS) { 
+$localMessage = * $Filename accessed\n; 
+$Message = $Message\n$localMessage; 
+$Mail{Subject} = [$PROGRAM]  . hostname() . : $Filename accessed;   
+print STDERR [$now] $localMessage if($VERBOSE0); 
+syslog(info,$localMessage) if($Path-{'syslog'}); 
+  } 
+  elsif($e-IN_ATTRIB) { 
+$localMessage = * $Filename attributes changed\n; 
+$Message = $Message\n$localMessage; 
+$Mail{Subject} = [$PROGRAM]  . hostname() . : $Filename attributes 
changed;   
+print STDERR [$now] $localMessage if($VERBOSE0); 
+syslog(info,$localMessage) if($Path-{'syslog'}); 
+  }
+  elsif($e-IN_CLOSE_NOWRITE) {
+$localMessage = * $Filename opened for reading closed\n;
+$Message = $Message\n$localMessage;
+$Mail{Subject} = [$PROGRAM]  . hostname() . : $Filename opened for 
reading closed;  
+print STDERR [$now] $localMessage if($VERBOSE0);
+syslog(info,$localMessage) if($Path-{'syslog'});
   }
   elsif($e-IN_CLOSE_WRITE  -f $Filename) {
-$localMessage = * $Filename is closed\n;
+$localMessage = * $Filename opened for writing closed\n;
 $Message = $Message\n$localMessage;
-$Mail{Subject} = [$PROGRAM]  . hostname() . : $Filename is changed;  
+$Mail{Subject} = [$PROGRAM]  . hostname() . : $Filename opened for 
writing closed;  
 print STDERR [$now] $localMessage if($VERBOSE0);
 syslog(info,$localMessage) if($Path-{'syslog'});
   }
@@ -353,6 +388,13 @@ sub mywatch {
 print STDERR [$now] $localMessage if($VERBOSE0);
 syslog(info,$localMessage) if($Path-{'syslog'});
   }
+  elsif($e-IN_MODIFY) { 
+$localMessage = * $Filename modified\n; 
+$Message = $Message\n$localMessage; 
+$Mail{Subject} = [$PROGRAM]  . hostname() . : $Filename modified;   
+print STDERR [$now] $localMessage