Changeset 77 for trunk


Ignore:
Timestamp:
Dec 21, 2006, 10:33:47 PM (18 years ago)
Author:
rainer
Message:

Fix for ticket #40 (No update if ReportOnlyOnce = False), and documentation
update.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/man/samhainrc.5

    r76 r77  
    593593for all.
    594594.br
     595.BI FilenamesAreUTF8= yes|no
     596Whether filenames are UTF-8 encoded (defaults to no). If yes, filenames
     597are checked for invalid UTF-8 encoding and for ending in invisible characters.
    595598.br
    596599.BI IgnoreAdded= path_regex
  • trunk/src/sh_files.c

    r68 r77  
    20312031  ++sh.statistics.files_checked;
    20322032     
    2033   if      ( sh.flag.checkSum == SH_CHECK_INIT && sh.flag.update == S_FALSE )
     2033  if ( sh.flag.checkSum == SH_CHECK_INIT /* && sh.flag.update == S_FALSE */)
    20342034    {
    20352035      sh_hash_pushdata (&theFile, fileHash);
    2036     }
    2037   else if (sh.flag.checkSum == SH_CHECK_INIT && sh.flag.update == S_TRUE )
    2038     {
    2039       if (0 == sh_hash_compdata (class, &theFile, fileHash, NULL, -1))
    2040         {
    2041           sh_hash_pushdata (&theFile, fileHash);
    2042         }
    20432036    }
    20442037  else if (sh.flag.checkSum == SH_CHECK_CHECK
  • trunk/src/sh_hash.c

    r76 r77  
    535535            }
    536536
    537           /* We rewrite the db on update, thus we need to push this out
     537          /* We rewrite the db on update, thus we need to keep this
    538538           * if the user does not want to purge it from the db.
    539539           */
    540           if (sh.flag.checkSum == SH_CHECK_INIT &&
    541               sh.flag.update   == S_TRUE &&
    542               S_FALSE          == sh_util_ask_update(p->fullpath))
    543             {
    544               theFile = sh_hash_create_ft (p, fileHash);
    545               sh_hash_pushdata (theFile, fileHash);
    546               if (theFile->attr_string)
    547                 SH_FREE(theFile->attr_string);
    548               SH_FREE(theFile);
    549             }
    550 
    551           if (sh.flag.reportonce == S_TRUE)
     540
     541          if ((sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE) ||
     542              (S_TRUE == sh.flag.update && S_TRUE == sh_util_ask_update(p->fullpath)))
    552543            {
    553544#ifdef REPLACE_OLD
     
    26112602  if (p == NULL)
    26122603    {
    2613       if (sh.flag.reportonce == S_TRUE)
    2614         {
    2615           p = sh_hash_push_int(theFile, fileHash);
    2616           hashinsert (p);
    2617           if (p)
    2618             p->modi_mask = theFile->check_mask;
    2619 
    2620         }
    2621 
    26222604      if (S_FALSE == sh_ignore_chk_new(theFile->fullpath))
    26232605        {
     
    26372619      if (sh.flag.reportonce == S_TRUE)
    26382620        theFile->reported = S_TRUE;
    2639        
    2640       if (sh.flag.isdaemon == S_FALSE && sh.flag.update == S_TRUE )
    2641         {
    2642           if (S_FALSE == sh_util_ask_update (theFile->fullpath))
     2621
     2622      if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
     2623        {
     2624          p = sh_hash_push_int(theFile, fileHash);
     2625          hashinsert (p);
     2626          if (p)
     2627            p->modi_mask = theFile->check_mask;
     2628        }
     2629
     2630      else if (S_TRUE == sh.flag.update)
     2631        {
     2632          if (S_TRUE == sh_util_ask_update (theFile->fullpath))
     2633            {
     2634              p = sh_hash_push_int(theFile, fileHash);
     2635              hashinsert (p);
     2636              if (p)
     2637                p->modi_mask = theFile->check_mask;
     2638            }
     2639          else
    26432640            {
    26442641              SL_RETURN(1, _("sh_hash_compdata"));
    2645             }
    2646         }
     2642            }
     2643        }
     2644       
    26472645      SL_RETURN(0, _("sh_hash_compdata"));
    26482646    }
     
    32643262              SL_RETURN(1, _("sh_hash_compdata"));
    32653263            }
    3266           else if (sh.flag.reportonce == S_TRUE)
     3264          else /* if (sh.flag.reportonce == S_TRUE) */
    32673265            {
    32683266              /* we replace the data in the in-memory copy of the
  • trunk/src/sh_processcheck.c

    r76 r77  
    163163static const short SH_PR_ANY      = 0x1000;
    164164
     165/* /proc:
     166 *        linux:     /proc/pid/exe
     167 *        freebsd:   /proc/pid/file
     168 *        solaris10: /proc/pid/path/a.out
     169 */
     170
    165171struct watchlist {
    166172  char        * str;
  • trunk/src/sh_readconf.c

    r68 r77  
    867867  { N_("addokchars"),         SH_SECTION_MISC,   SH_SECTION_NONE,
    868868    sh_util_obscure_ok },
    869   { N_("filenamesareutf8"),   SH_SECTION_MISC,   SH_SECTION_NONE, /* FIXME document this option */
     869  { N_("filenamesareutf8"),   SH_SECTION_MISC,   SH_SECTION_NONE,
    870870    sh_util_obscure_utf8 },
    871871  { N_("setrecursionlevel"),  SH_SECTION_MISC,   SH_SECTION_NONE,
Note: See TracChangeset for help on using the changeset viewer.