#4 cosmetic report fix

closed
None
5
2004-11-12
2003-11-26
No

The reports that are generated when the database is
initialized or if all files check out OK really don't
give the right visual indication that something useful
happened. This code applied to the current CVS tree
will at least print the basic message. This is
especially useful when automatically emailing reports
around.

*** aide.c.old 2003-11-26 14:23:47.000000000 -0600
--- aide.c.new 2003-11-26 14:29:42.000000000 -0600
***************
*** 540,545 ****
--- 540,553 ----
/* Then detailed list of changes */
stat[0]=1;
report_tree(conf->tree,4,stat);
+ } else {
+ printf("\nAIDE, version " AIDEVERSION "\n\n");
+ if(conf->action&DO_COMPARE) {
+ printf("### All files match AIDE database.
Looks okay!\n\n");
+ }
+ if(conf->action&DO_INIT) {
+ printf("### AIDE database initialized.\n\n");
+ }
}
db_close(conf);

Discussion

  • Richard van den Berg

    • assigned_to: nobody --> rvdb
    • status: open --> closed
     
  • Richard van den Berg

    Logged In: YES
    user_id=330646

    Patch applied to CVS.

     
  • John Kristoff

    John Kristoff - 2004-02-13

    Logged In: YES
    user_id=238328

    Changed patch to use the error() function. This uses the
    default level of 5, which will display the version and init
    status by default. I think this would be the preferred
    behavior, but if not, please adjust the level if necessary.

    John

    --- aide.c.old
    +++ aide.c.new
    @@ -543,12 +543,12 @@
    stat[0]=1;
    report_tree(conf->tree,4,stat);
    } else {
    - error(5,"\nAIDE, version " AIDEVERSION "\n\n");
    + printf("\nAIDE, version " AIDEVERSION "\n\n");
    if(conf->action&DO_COMPARE) {
    - error(5,"### All files match AIDE database. Looks
    okay!\n\n");
    + printf("### All files match AIDE database. Looks
    okay!\n\n");
    }
    if(conf->action&DO_INIT) {
    - error(5,"### AIDE database initialized.\n\n");
    + printf("### AIDE database initialized.\n\n");
    }
    }
    db_close(conf);

     
  • John Kristoff

    John Kristoff - 2004-02-13
    • status: closed --> open
     
  • John Kristoff

    John Kristoff - 2004-02-13

    Logged In: YES
    user_id=238328

    Whoops, did the diff in the wrong order in the previous
    comment and attachment. I imagine you can figure it out. :-)

    John

     
  • Richard van den Berg

    • status: open --> closed
     
  • Richard van den Berg

    Logged In: YES
    user_id=330646

    This was solved by adding a if (conf->verbose_level > 5)
    around the printfs. This will ensure the messages goes to
    stdout instead of the selected error channel.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks