Changeset 310 for trunk/src


Ignore:
Timestamp:
Feb 16, 2011, 9:33:00 PM (14 years ago)
Author:
katerina
Message:

Add option to skip checksum for certain files (ticket #232). Also fix for #231 (missing warning on invalid recursion depth).

Location:
trunk/src
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/samhain.c

    r307 r310  
    7171#include "sh_readconf.h"
    7272#include "sh_hash.h"
     73#include "sh_restrict.h"
    7374
    7475#include "sh_nmail.h"
     
    17861787#endif
    17871788#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
     1789              sh_restrict_purge ();
    17881790
    17891791
  • trunk/src/sh_files.c

    r307 r310  
    11471147  p = sh_files_C_dequote(p, &len);
    11481148  if (!p || len == 0)
    1149     SL_RETURN((-1), _("sh_files_pushdir"));
     1149    SL_RETURN((-1), _("sh_files_pushfile"));
    11501150
    11511151  if (len >= PATH_MAX)
     
    15441544 
    15451545
    1546   if (rdepth < (-1) || tail == p || rdepth > 99)
    1547     rdepth = (-2);
     1546  if (tail == p)
     1547    {
     1548      /* Setting to an invalid number will force MaxRecursionLevel,
     1549       * see sh_files_setrec_int()
     1550       */
     1551      rdepth = (-2);
     1552    }
     1553  else if ( (rdepth < (-1) || rdepth > 99) ||
     1554            ((rdepth == (-1)) && (class != SH_LEVEL_ALLIGNORE)) )
     1555    {
     1556      SH_FREE(p);
     1557      SL_RETURN((-1), _("sh_files_pushdir"));
     1558    }
    15481559
    15491560  len = sl_strlen(tail);
  • trunk/src/sh_readconf.c

    r290 r310  
    4848#include "sh_unix.h"
    4949#include "sh_utils.h"
     50#include "sh_restrict.h"
    5051
    5152
     
    942943    sh_files_pushfile_prelink },
    943944
    944   { N_("ignoreadded"), SH_SECTION_MISC,   SH_SECTION_NONE,
     945  { N_("ignoreadded"),   SH_SECTION_MISC,   SH_SECTION_NONE,
    945946    sh_ignore_add_new },
    946947  { N_("ignoremissing"), SH_SECTION_MISC,   SH_SECTION_NONE,
    947948    sh_ignore_add_del },
     949
     950  { N_("skipchecksum"),  SH_SECTION_MISC,   SH_SECTION_NONE,
     951    sh_restrict_define },
     952  { N_("filetype"),      SH_SECTION_MISC,   SH_SECTION_NONE,
     953    sh_restrict_add_ftype },
     954
    948955
    949956  { N_("filecheckscheduleone"), SH_SECTION_MISC,   SH_SECTION_NONE,
  • trunk/src/sh_unix.c

    r295 r310  
    9898#include "sh_hash.h"
    9999#include "sh_tools.h"
     100#include "sh_restrict.h"
    100101#include "sh_ipvx.h"
    101102#include "sh_tiger.h"
     
    37493750      if (fileHash != NULL)
    37503751        {
    3751           if ((theFile->check_mask & MODI_CHK) == 0)
     3752          if ((theFile->check_mask & MODI_CHK) == 0 ||
     3753              sh_restrict_this(theFile->fullpath, (UINT64) fbuf.st_size,
     3754                               (UINT64) fbuf.st_mode, rval_open))
    37523755            {
    37533756              sl_strlcpy(fileHash, SH_KEY_NULL, KEY_LEN+1);
     
    38023805      if (fileHash != NULL)
    38033806        {
    3804           if ((theFile->check_mask & MODI_CHK) == 0)
     3807          if ((theFile->check_mask & MODI_CHK) == 0 ||
     3808              sh_restrict_this(theFile->fullpath, (UINT64) fbuf.st_size,
     3809                               (UINT64) fbuf.st_mode, rval_open))
    38053810            {
    38063811              sl_strlcpy(fileHash, SH_KEY_NULL, KEY_LEN+1);
Note: See TracChangeset for help on using the changeset viewer.