[Aide] patch3: report enhancements

Vincent Danen vdanen at linsec.ca
Sat Jan 28 19:07:22 EET 2006


I find the output of the tripwire reports to much easier to read than
those from aide, so I changed the output of the report/compare reports
to be a little easier to read and differentiate, at a glance, what is
what.  It's more cosmetic (like the last patch) than anything else, but
I've already found it to make reading the aide reports much easier.

This is the last of my patches (so far); I've applied them to the latest
CVS and they apply and work fine.  One thing I'm planning to do yet is
to have the --compare option indicate what files are being compared;
currently it just says it's comparing but it would be good to know what
files are being compared (ie. if you write the report to a file and look
at it later, you'll know what you did as the config may change or you
may have used -B to set the database names).

I am also tweaking my gpg-related scripts to actually enforce the usage
of gpg (and adding an aideinit script that creates the database and a
gpg key at the same time).  I'll fire those off to the list once I'm
satisfied with them as well.

Any ETA on when 0.11 will be released?  I'm looking to release Annvix
1.2-RELEASE in the next week or so and want to pull out tripwire and
replace it with aide.  AFAIC the current CVS snapshot works well enough,
and with my patches looks pretty enough to use... =)  But it would be
nice to use a "final" version rather than a CVS snapshot.

Are there any outstanding problems I should be aware of before I go
ahead and do this tho?

Thanks.

-- 
Annvix - Secure Linux Server: http://annvix.org/
"lynx -source http://linsec.ca/vdanen.asc | gpg --import"
{FEE30AD4 : 7F6C A60C 06C2 4811 FA1C  A2BC 2EBC 5E32 FEE3 0AD4}
Wasting time like it was free...
-------------- next part --------------
This patch pretties up the report output a little bit.

--- aide-0.11-rc2/src/compare_db.c.pretty	2005-10-25 05:42:38.000000000 -0600
+++ aide-0.11-rc2/src/compare_db.c	2006-01-21 15:54:39.000000000 -0700
@@ -616,8 +616,8 @@
   error(2,_("Start timestamp: %0.4u-%0.2u-%0.2u %0.2u:%0.2u:%0.2u\n"),
 	st->tm_year+1900, st->tm_mon+1, st->tm_mday,
 	st->tm_hour, st->tm_min, st->tm_sec);
-  error(0,_("Summary:\nTotal number of files=%i,added files=%i"
-	    ",removed files=%i,changed files=%i\n\n"),nfil,nadd,nrem,nchg);
+  error(0,_("\nSummary:\n  Total number of files:\t%i\n  Added files:\t\t\t%i\n"
+	    "  Removed files:\t\t%i\n  Changed files:\t\t%i\n\n"),nfil,nadd,nrem,nchg);
   
 }
 
@@ -737,7 +737,9 @@
     print_report_header(nfil,nadd,nrem,nchg);
 
     if(nadd!=0){
+      error(2,_("\n---------------------------------------------------\n"));
       error(2,_("Added files:\n"));
+      error(2,_("---------------------------------------------------\n\n"));
       for(r=added;r;r=r->next){
 	error(2,"added:%s\n",((db_line*)r->data)->filename);
 	if(conf->verbose_level<20){
@@ -761,21 +763,27 @@
     
 
     if(nrem!=0){
+      error(2,_("\n---------------------------------------------------\n"));
       error(2,_("Removed files:\n"));
+      error(2,_("---------------------------------------------------\n\n"));
       for(r=removed;r;r=r->next){
 	error(2,"removed:%s\n",((db_line*)r->data)->filename);
       }
     }
 
     if(nchg!=0){
+      error(2,_("\n---------------------------------------------------\n"));
       error(2,_("Changed files:\n"));
+      error(2,_("---------------------------------------------------\n\n"));
       for(r=changedold;r;r=r->next){
 	error(2,"changed:%s\n",((db_line*)r->data)->filename);
       }
     }
 
     if((conf->verbose_level>=5)&&(nchg!=0)){
+      error(2,_("\n---------------------------------------------------\n"));
       error(2,_("Detailed information about changes:\n"));
+      error(2,_("---------------------------------------------------\n\n"));
       for(r=changedold,l=changednew;r;r=r->next,l=l->next){
 	int localignorelist=((db_line*)l->data)->attr^((db_line*)r->data)->attr;
 	localignorelist|=ignorelist;
@@ -851,32 +859,44 @@
   }
 
   if((stage==1)&&stat[2]){
-    if(top)
+    if(top){
+      error(2,_("\n---------------------------------------------------\n"));
       error(2,_("Added files:\n"));
+      error(2,_("---------------------------------------------------\n\n"));
+    }
     if(node->checked&NODE_ADDED){
       error(2,_("added:%s\n"),node->new_data->filename);
     }
   }
 
   if((stage==2)&&stat[3]){
-    if(top)
+    if(top){
+      error(2,_("\n---------------------------------------------------\n"));
       error(2,_("Removed files:\n"));
+      error(2,_("---------------------------------------------------\n\n"));
+    }
     if(node->checked&NODE_REMOVED){
       error(2,_("removed:%s\n"),node->old_data->filename);
     }
   }
 
   if((stage==3)&&stat[4]){
-    if(top)
+    if(top){
+      error(2,_("\n---------------------------------------------------\n"));
       error(2,_("Changed files:\n"));
+      error(2,_("---------------------------------------------------\n\n"));
+    }
     if(node->checked&NODE_CHANGED){
       error(2,_("changed:%s\n"),node->new_data->filename);
     }
   }
 
   if((stage==4)&&(conf->verbose_level>=5)&&stat[4]){
-    if(top)
+    if(top){
+      error(2,_("\n--------------------------------------------------\n"));
       error(2,_("Detailed information about changes:\n"));
+      error(2,_("---------------------------------------------------\n\n"));
+    }
     if(node->checked&NODE_CHANGED){
       print_dbline_changes(node->old_data,node->new_data,ignorelist);
     }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : https://mailman.cs.tut.fi/pipermail/aide/attachments/20060128/aac34612/attachment.bin


More information about the Aide mailing list