diff --git a/CHANGES b/CHANGES index 14c2590cd6..9c69cb727a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,9 @@ +2.3-551 | 2015-03-17 09:22:37 -0700 + + * Deprecate &rotate_interval, &rotate_size, &encrypt. Addresses + BIT-1305. (Jon Siwek) + 2.3-549 | 2015-03-17 09:12:18 -0700 * BIT-1077: Fix HTTP::log_server_header_names. Before, it just diff --git a/VERSION b/VERSION index 6f4385df7d..74fa78ca1a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.3-549 +2.3-551 diff --git a/doc/script-reference/attributes.rst b/doc/script-reference/attributes.rst index ef6c6a54a1..40646f64f4 100644 --- a/doc/script-reference/attributes.rst +++ b/doc/script-reference/attributes.rst @@ -43,8 +43,6 @@ The Bro scripting language supports the following attributes. +-----------------------------+-----------------------------------------------+ | :bro:attr:`&mergeable` |Prefer set union for synchronized state. | +-----------------------------+-----------------------------------------------+ -| :bro:attr:`&group` |Group event handlers to activate/deactivate. | -+-----------------------------+-----------------------------------------------+ | :bro:attr:`&error_handler` |Used internally for reporter framework events. | +-----------------------------+-----------------------------------------------+ | :bro:attr:`&type_column` |Used by input framework for "port" type. | @@ -198,11 +196,6 @@ Here is a more detailed explanation of each attribute: inconsistencies and can be avoided by unifying the two sets, rather than merely overwriting the old value. -.. bro:attr:: &group - - Groups event handlers such that those in the same group can be - jointly activated or deactivated. - .. bro:attr:: &error_handler Internally set on the events that are associated with the reporter diff --git a/src/scan.l b/src/scan.l index b13215e4b8..a6e37a67f7 100644 --- a/src/scan.l +++ b/src/scan.l @@ -56,6 +56,11 @@ char last_tok[128]; if ( ((result = fread(buf, 1, max_size, yyin)) == 0) && ferror(yyin) ) \ reporter->Error("read failed with \"%s\"", strerror(errno)); +static void deprecated_attr(const char* attr) + { + reporter->Warning("Use of deprecated attribute: %s", attr); + } + static string find_relative_file(const string& filename, const string& ext) { if ( filename.empty() ) @@ -263,22 +268,50 @@ when return TOK_WHEN; &delete_func return TOK_ATTR_DEL_FUNC; &deprecated return TOK_ATTR_DEPRECATED; &raw_output return TOK_ATTR_RAW_OUTPUT; -&encrypt return TOK_ATTR_ENCRYPT; &error_handler return TOK_ATTR_ERROR_HANDLER; &expire_func return TOK_ATTR_EXPIRE_FUNC; &log return TOK_ATTR_LOG; -&mergeable return TOK_ATTR_MERGEABLE; &optional return TOK_ATTR_OPTIONAL; -&persistent return TOK_ATTR_PERSISTENT; &priority return TOK_ATTR_PRIORITY; &type_column return TOK_ATTR_TYPE_COLUMN; &read_expire return TOK_ATTR_EXPIRE_READ; &redef return TOK_ATTR_REDEF; -&rotate_interval return TOK_ATTR_ROTATE_INTERVAL; -&rotate_size return TOK_ATTR_ROTATE_SIZE; -&synchronized return TOK_ATTR_SYNCHRONIZED; &write_expire return TOK_ATTR_EXPIRE_WRITE; +&encrypt { + deprecated_attr(yytext); + return TOK_ATTR_ENCRYPT; + } + +&mergeable { + // Not yet deprecated, but soon. + //deprecated_attr(yytext); + return TOK_ATTR_MERGEABLE; + } + +&persistent { + // Not yet deprecated, but soon. + //deprecated_attr(yytext); + return TOK_ATTR_PERSISTENT; + } + +&rotate_interval { + deprecated_attr(yytext); + return TOK_ATTR_ROTATE_INTERVAL; + } + +&rotate_size { + deprecated_attr(yytext); + return TOK_ATTR_ROTATE_SIZE; + } + +&synchronized { + // Not yet deprecated, but soon. + //deprecated_attr(yytext); + return TOK_ATTR_SYNCHRONIZED; + } + + @DEBUG return TOK_DEBUG; // marks input for debugger @DIR {