Ignore:
Timestamp:
Jul 18, 2015, 5:06:52 PM (9 years ago)
Author:
katerina
Message:

Enhancements and fixes for tickets #374, #375, #376, #377, #378, and #379.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_log_evalrule.c

    r383 r481  
    470470}
    471471
    472 static struct sh_qeval ** dummy_queue;
    473 static char            ** dummy_dstr;
     472struct sh_qeval ** sh_dummy_472_queue;
     473char            ** sh_dummy_473_dstr;
    474474
    475475int sh_eval_radd (const char * str)
     
    477477  struct sh_geval * nr;
    478478  struct sh_geval * tmp;
    479   struct sh_qeval * queue = NULL;
     479  struct sh_qeval * queue;
    480480  pcre *  rule;
    481481  pcre_extra * rule_extra;
     
    506506  splits = split_array(new, &nfields, ':', lengths);
    507507
    508   dummy_queue = &queue;
    509   dummy_dstr  = &dstr;
     508  sh_dummy_472_queue = &queue;
     509  sh_dummy_473_dstr  = &dstr;
     510
     511  queue = NULL;
    510512
    511513  if (nfields < 2 || nfields > 3)
     
    593595  pcre_fullinfo(rule, rule_extra, PCRE_INFO_CAPTURECOUNT, &captures);
    594596
    595   if (flag_err_debug == SL_TRUE)
     597  if (flag_err_debug == S_TRUE)
    596598    {
    597599      char * emsg = SH_ALLOC(SH_ERRBUF_SIZE);
     
    654656  if (group_open)
    655657    {
    656       if (flag_err_debug == SL_TRUE)
     658      if (flag_err_debug == S_TRUE)
    657659        {
    658660          char * emsg = SH_ALLOC(SH_ERRBUF_SIZE);
     
    826828 * filled in
    827829 */
    828 static struct sh_geval ** dummy1;
     830struct sh_geval ** sh_dummy_828_rule;
    829831
    830832static struct sh_geval * test_rule (struct sh_geval * rule, sh_string *msg, time_t tstamp)
     
    834836  volatile time_t timestamp = tstamp;
    835837
    836   dummy1 = &rule;
     838  sh_dummy_828_rule = &rule;
    837839
    838840  if (!rule)
     
    844846      do {
    845847
    846         if (flag_err_debug == SL_TRUE)
     848        if (flag_err_debug == S_TRUE)
    847849          {
    848850            char * emsg = SH_ALLOC(SH_ERRBUF_SIZE);
     
    864866            rule->ovecnum = res;
    865867
    866             if (flag_err_debug == SL_TRUE)
     868            if (flag_err_debug == S_TRUE)
    867869              {
    868870                char * emsg = SH_ALLOC(SH_ERRBUF_SIZE);
     
    900902          }
    901903
    902         if (flag_err_debug == SL_TRUE)
     904        if (flag_err_debug == S_TRUE)
    903905          {
    904906            char * emsg = SH_ALLOC(SH_ERRBUF_SIZE);
     
    919921    DEBUG("debug: no match found\n");
    920922  /* If there was no match, this is NULL */
    921   dummy1 = NULL;
     923  sh_dummy_828_rule = NULL;
    922924  return rule;
    923925}
     
    926928 * against msg
    927929 */
    928 static struct sh_geval ** dummy2;
    929 static struct sh_geval ** dummy3;
     930struct sh_geval ** sh_dummy_928_result;
     931struct sh_geval ** sh_dummy_929_group;
    930932
    931933static struct sh_geval * test_grules (struct sh_heval * host,
     
    936938  struct sh_geval * group  = host->rulegroups;
    937939
    938   dummy2 = &result;
    939   dummy3 = &group;
     940  sh_dummy_928_result = &result;
     941  sh_dummy_929_group = &group;
    940942
    941943  if (group && sh_string_len(msg) < (size_t)INT_MAX)
     
    947949            /* this is a rule group */
    948950
    949             if (flag_err_debug == SL_TRUE)
     951            if (flag_err_debug == S_TRUE)
    950952              {
    951953                char * emsg = SH_ALLOC(SH_ERRBUF_SIZE);
     
    975977             */
    976978
    977             if (flag_err_debug == SL_TRUE)
     979            if (flag_err_debug == S_TRUE)
    978980              {
    979981                char * emsg = SH_ALLOC(SH_ERRBUF_SIZE);
     
    995997    }
    996998
    997   dummy2 = NULL;
    998   dummy3 = NULL;
     999  sh_dummy_928_result = NULL;
     1000  sh_dummy_929_group = NULL;
    9991001  return result;
    10001002}
     
    11131115static zAVLKey sh_eval_getkey(void const *item)
    11141116{
    1115   return ((struct sh_ceval *)item)->hostname->str;
     1117  return ((const struct sh_ceval *)item)->hostname->str;
    11161118}
    11171119
Note: See TracChangeset for help on using the changeset viewer.