From 1899830632bf4275829fce19dc2a532b7da72b65 Mon Sep 17 00:00:00 2001 From: Pablo Rincon Date: Thu, 1 Jul 2010 13:22:25 +0200 Subject: [PATCH 5/5] Updating other http modifiers for sigs with fast_pattern option --- src/detect-http-client-body.c | 8 ++++++++ src/detect-http-header.c | 8 ++++++++ src/detect-http-uri.c | 8 ++++++++ 3 files changed, 24 insertions(+), 0 deletions(-) diff --git a/src/detect-http-client-body.c b/src/detect-http-client-body.c index 41d0de5..7799793 100644 --- a/src/detect-http-client-body.c +++ b/src/detect-http-client-body.c @@ -198,6 +198,14 @@ int DetectHttpClientBodySetup(DetectEngineCtx *de_ctx, Signature *s, char *arg) return -1; } + if (((DetectContentData *)sm->ctx)->flags & DETECT_CONTENT_FAST_PATTERN) + { + SCLogWarning(SC_WARN_COMPATIBILITY, + "http_client_body cannot be used with \"fast_pattern\" currently." + "Unsetting fast_pattern on this modifier. Signature ==> %s", s->sig_str); + ((DetectContentData *)sm->ctx)->flags &= ~DETECT_CONTENT_FAST_PATTERN; + } + /* http_client_body should not be used with the rawbytes rule */ if ( ((DetectContentData *)sm->ctx)->flags & DETECT_CONTENT_RAWBYTES) { SCLogError(SC_ERR_INVALID_SIGNATURE, "http_client_body rule can not " diff --git a/src/detect-http-header.c b/src/detect-http-header.c index fd79f90..4ebedb8 100644 --- a/src/detect-http-header.c +++ b/src/detect-http-header.c @@ -202,6 +202,14 @@ int DetectHttpHeaderSetup(DetectEngineCtx *de_ctx, Signature *s, char *arg) return -1; } + if (((DetectContentData *)sm->ctx)->flags & DETECT_CONTENT_FAST_PATTERN) + { + SCLogWarning(SC_WARN_COMPATIBILITY, + "http_header cannot be used with \"fast_pattern\" currently." + "Unsetting fast_pattern on this modifier. Signature ==> %s", s->sig_str); + ((DetectContentData *)sm->ctx)->flags &= ~DETECT_CONTENT_FAST_PATTERN; + } + /* http_header should not be used with the rawbytes rule */ if ( ((DetectContentData *)sm->ctx)->flags & DETECT_CONTENT_RAWBYTES) { SCLogError(SC_ERR_INVALID_SIGNATURE, "http_header rule can not " diff --git a/src/detect-http-uri.c b/src/detect-http-uri.c index 135c2f1..fe7501b 100644 --- a/src/detect-http-uri.c +++ b/src/detect-http-uri.c @@ -108,6 +108,14 @@ static int DetectHttpUriSetup (DetectEngineCtx *de_ctx, Signature *s, char *str) return -1; } + if (((DetectContentData *)pm->ctx)->flags & DETECT_CONTENT_FAST_PATTERN) + { + SCLogWarning(SC_WARN_COMPATIBILITY, + "http_uri cannot be used with \"fast_pattern\" currently." + "Unsetting fast_pattern on this modifier. Signature ==> %s", s->sig_str); + ((DetectContentData *)pm->ctx)->flags &= ~DETECT_CONTENT_FAST_PATTERN; + } + /* http_uri should not be used with the rawbytes rule */ if (((DetectContentData *)pm->ctx)->flags & DETECT_CONTENT_RAWBYTES) { -- 1.6.5