Project

General

Profile

Bug #455 » 0001-bug-455-Warn-users-on-signature-event-vars-having-pr.patch

Anoop Saldanha, 06/29/2012 12:24 PM

View differences:

src/util-error.c
230 230
        CASE_CODE (SC_ERR_MEM_BUFFER_API);
231 231
        CASE_CODE (SC_ERR_INVALID_MD5);
232 232
        CASE_CODE (SC_ERR_NO_MD5_SUPPORT);
233

  
233
        CASE_CODE (SC_ERR_EVENT_ENGINE);
234 234
        default:
235 235
            return "UNKNOWN_ERROR";
236 236
    }
src/util-error.h
244 244
    SC_ERR_MEM_BUFFER_API,
245 245
    SC_ERR_INVALID_MD5,
246 246
    SC_ERR_NO_MD5_SUPPORT,
247
    SC_ERR_EVENT_ENGINE,
247 248
} SCError;
248 249

  
249 250
const char *SCErrorToString(SCError);
src/util-threshold-config.c
560 560
            m = SigMatchGetLastSMFromLists(s, 2,
561 561
                                           DETECT_THRESHOLD, s->sm_lists[DETECT_SM_LIST_THRESHOLD]);
562 562

  
563
            if(m != NULL)
563
            if (m != NULL) {
564
                SCLogWarning(SC_ERR_EVENT_ENGINE, "signature sid:%"PRIu32 " has "
565
                             "an event var set.  The signature event var is "
566
                             "given precedence over the threshold.conf one.  "
567
                             "We'll change this in the future though.", id);
564 568
                goto end;
569
            }
565 570

  
566 571
            m = SigMatchGetLastSMFromLists(s, 2,
567 572
                                           DETECT_DETECTION_FILTER, s->sm_lists[DETECT_SM_LIST_THRESHOLD]);
568 573

  
569
            if(m != NULL)
574
            if (m != NULL) {
575
                SCLogWarning(SC_ERR_EVENT_ENGINE, "signature sid:%"PRIu32 " has "
576
                             "an event var set.  The signature event var is "
577
                             "given precedence over the threshold.conf one.  "
578
                             "We'll change this in the future though.", id);
570 579
                goto end;
580
            }
571 581

  
572 582
            de = SCMalloc(sizeof(DetectThresholdData));
573 583
            if (de == NULL)
......
631 641
                m = SigMatchGetLastSMFromLists(s, 2,
632 642
                                               DETECT_THRESHOLD, s->sm_lists[DETECT_SM_LIST_THRESHOLD]);
633 643

  
634
                if(m != NULL)
644
                if (m != NULL) {
645
                    SCLogWarning(SC_ERR_EVENT_ENGINE, "signature sid:%"PRIu32 " has "
646
                                 "an event var set.  The signature event var is "
647
                                 "given precedence over the threshold.conf one.  "
648
                                 "We'll change this in the future though.", id);
635 649
                    goto end;
650
                }
636 651

  
637 652
                m = SigMatchGetLastSMFromLists(s, 2,
638 653
                                               DETECT_DETECTION_FILTER, s->sm_lists[DETECT_SM_LIST_THRESHOLD]);
639 654

  
640
                if(m != NULL)
655
                if (m != NULL) {
656
                    SCLogWarning(SC_ERR_EVENT_ENGINE, "signature sid:%"PRIu32 " has "
657
                                 "an event var set.  The signature event var is "
658
                                 "given precedence over the threshold.conf one.  "
659
                                 "We'll change this in the future though.", id);
641 660
                    goto end;
661
                }
642 662

  
643 663
                de = SCMalloc(sizeof(DetectThresholdData));
644 664
                if (de == NULL)
......
692 712
            }
693 713
            s = ns;
694 714
        }
715
    } else if (id > 0 && gid == 0) {
716
        SCLogError(SC_ERR_INVALID_VALUE, "Can't use a event config that has "
717
                   "sid > 0 and gid == 0.  Killing engine.  Please fix this "
718
                   "in your threshold.conf file");
719
        exit(EXIT_FAILURE);
695 720
    } else {
696 721
        sig = SigFindSignatureBySidGid(de_ctx,id,gid);
697 722

  
......
704 729
            m = SigMatchGetLastSMFromLists(sig, 2,
705 730
                                           DETECT_THRESHOLD, sig->sm_lists[DETECT_SM_LIST_THRESHOLD]);
706 731

  
707
            if(m != NULL)
732
            if (m != NULL) {
733
                SCLogWarning(SC_ERR_EVENT_ENGINE, "signature sid:%"PRIu32 " has "
734
                             "an event var set.  The signature event var is "
735
                             "given precedence over the threshold.conf one.  "
736
                             "We'll change this in the future though.", id);
708 737
                goto end;
738
            }
709 739

  
710 740
            m = SigMatchGetLastSMFromLists(sig, 2,
711 741
                                           DETECT_DETECTION_FILTER, sig->sm_lists[DETECT_SM_LIST_THRESHOLD]);
712 742

  
713
            if(m != NULL)
743
            if (m != NULL) {
744
                SCLogWarning(SC_ERR_EVENT_ENGINE, "signature sid:%"PRIu32 " has "
745
                             "an event var set.  The signature event var is "
746
                             "given precedence over the threshold.conf one.  "
747
                             "We'll change this in the future though.", id);
714 748
                goto end;
749
            }
715 750

  
716 751
            de = SCMalloc(sizeof(DetectThresholdData));
717 752
            if (de == NULL)
(4-4/4)