Changeset 356


Ignore:
Timestamp:
Sep 5, 2011, 9:31:27 PM (13 years ago)
Author:
katerina
Message:

Patch for ticket #261: show policy for checked files in verbose mode.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/Changelog

    r355 r356  
    112.8.6:
     2        * List the policy under which a directory/file is checked
    23        * Option to use a textfile with a list of files for update
    34        * Fix --enable-db-reload option (reported by David L.)
  • trunk/include/sh_hash.h

    r305 r356  
    2727#include "sh_unix.h"
    2828#include "sh_error.h"
     29
     30/* convert to policy string
     31 */
     32const char * sh_hash_getpolicy(int class);
    2933
    3034/* format a uint64
  • trunk/src/sh_cat.c

    r294 r356  
    4040  { MSG_FI_CSUM,     SH_ERR_ALL,     FIL,   N_("msg=\"Checksum\" chk=\"%s\" path=\"%s\"")},
    4141  { MSG_FI_DSUM,     SH_ERR_INFO,    FIL,   N_("msg=\"d: %3ld, -: %3ld, l: %3ld, |: %3ld, s: %3ld, c: %3ld, b: %3ld\"")},
    42   { MSG_FI_CHK,      SH_ERR_INFO,    FIL,   N_("msg=\"Checking\" path=\"%s\"")},
     42  { MSG_FI_CHK,      SH_ERR_INFO,    FIL,   N_("msg=\"Checking %16s\" path=\"%s\"")},
    4343#endif
    4444
     
    181181  { MSG_FI_CSUM,     SH_ERR_ALL,     FIL,   N_("msg=\"Checksum\" chk=\"%s\" path=\"%s\"")},
    182182  { MSG_FI_DSUM,     SH_ERR_INFO,    FIL,   N_("msg=\"d: %3ld, -: %3ld, l: %3ld, |: %3ld, s: %3ld, c: %3ld, b: %3ld\"")},
    183   { MSG_FI_CHK,      SH_ERR_INFO,    FIL,   N_("msg=\"Checking\" path=\"%s\"")},
     183  { MSG_FI_CHK,      SH_ERR_INFO,    FIL,   N_("msg=\"Checking %16s\" path=\"%s\"")},
    184184#endif
    185185
     
    382382  { MSG_FI_CSUM,     SH_ERR_ALL,     FIL,   N_("msg=<Checksum>, chk=<%s>, path=<%s>")},
    383383  { MSG_FI_DSUM,     SH_ERR_INFO,    FIL,   N_("msg=<d: %3ld, -: %3ld, l: %3ld, |: %3ld, s: %3ld, c: %3ld, b: %3ld>")},
    384   { MSG_FI_CHK,      SH_ERR_INFO,    FIL,   N_("msg=<Checking>, path=<%s>")},
     384  { MSG_FI_CHK,      SH_ERR_INFO,    FIL,   N_("msg=<Checking %16s>, path=<%s>")},
    385385#endif
    386386
     
    522522  { MSG_FI_CSUM,     SH_ERR_ALL,     FIL,   N_("msg=<Checksum>, chk=<%s>, path=<%s>")},
    523523  { MSG_FI_DSUM,     SH_ERR_INFO,    FIL,   N_("msg=<d: %3ld, -: %3ld, l: %3ld, |: %3ld, s: %3ld, c: %3ld, b: %3ld>")},
    524   { MSG_FI_CHK,      SH_ERR_INFO,    FIL,   N_("msg=<Checking>, path=<%s>")},
     524  { MSG_FI_CHK,      SH_ERR_INFO,    FIL,   N_("msg=<Checking %16s>, path=<%s>")},
    525525#endif
    526526
  • trunk/src/sh_files.c

    r310 r356  
    351351          if (flag_err_info == SL_TRUE)
    352352            {
     353              char pstr[32];
    353354#if !defined(WITH_TPT)
    354355              tmp = sh_util_safe_name (ptr->name);
    355356#endif
    356               sh_error_handle ((-1),  FIL__, __LINE__, 0, MSG_FI_CHK, tmp);
     357              sl_strlcpy(pstr, sh_hash_getpolicy(ptr->class), sizeof(pstr));
     358              sh_error_handle ((-1),  FIL__, __LINE__, 0, MSG_FI_CHK, pstr, tmp);
    357359            }
    358360
     
    18081810  if (flag_err_info == SL_TRUE)
    18091811    {
    1810       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_CHK, tmpname);
     1812      char pstr[32];
     1813
     1814      sl_strlcpy(pstr, sh_hash_getpolicy(iclass), sizeof(pstr));
     1815      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_CHK, pstr, tmpname);
    18111816    }
    18121817
  • trunk/src/sh_hash.c

    r354 r356  
    307307  };
    308308
     309const char * sh_hash_getpolicy(int class)
     310{
     311  if (class > 0 && class < SH_ERR_T_DIR)
     312    return _(policy[class]);
     313  return _("[indef]");
     314}
    309315
    310316/**********************************
Note: See TracChangeset for help on using the changeset viewer.