Merge remote-tracking branch 'origin/topic/jsiwek/bit-1305'

* origin/topic/jsiwek/bit-1305:
  Deprecate &rotate_interval, &rotate_size, &encrypt, &mergeable.

BIT-1305 #merged
This commit is contained in:
Robin Sommer 2015-03-17 09:22:37 -07:00
commit e3be3c9e02
4 changed files with 45 additions and 14 deletions

View file

@ -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 2.3-549 | 2015-03-17 09:12:18 -0700
* BIT-1077: Fix HTTP::log_server_header_names. Before, it just * BIT-1077: Fix HTTP::log_server_header_names. Before, it just

View file

@ -1 +1 @@
2.3-549 2.3-551

View file

@ -43,8 +43,6 @@ The Bro scripting language supports the following attributes.
+-----------------------------+-----------------------------------------------+ +-----------------------------+-----------------------------------------------+
| :bro:attr:`&mergeable` |Prefer set union for synchronized state. | | :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:`&error_handler` |Used internally for reporter framework events. |
+-----------------------------+-----------------------------------------------+ +-----------------------------+-----------------------------------------------+
| :bro:attr:`&type_column` |Used by input framework for "port" type. | | :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 inconsistencies and can be avoided by unifying the two sets, rather
than merely overwriting the old value. 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 .. bro:attr:: &error_handler
Internally set on the events that are associated with the reporter Internally set on the events that are associated with the reporter

View file

@ -56,6 +56,11 @@ char last_tok[128];
if ( ((result = fread(buf, 1, max_size, yyin)) == 0) && ferror(yyin) ) \ if ( ((result = fread(buf, 1, max_size, yyin)) == 0) && ferror(yyin) ) \
reporter->Error("read failed with \"%s\"", strerror(errno)); 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) static string find_relative_file(const string& filename, const string& ext)
{ {
if ( filename.empty() ) if ( filename.empty() )
@ -263,22 +268,50 @@ when return TOK_WHEN;
&delete_func return TOK_ATTR_DEL_FUNC; &delete_func return TOK_ATTR_DEL_FUNC;
&deprecated return TOK_ATTR_DEPRECATED; &deprecated return TOK_ATTR_DEPRECATED;
&raw_output return TOK_ATTR_RAW_OUTPUT; &raw_output return TOK_ATTR_RAW_OUTPUT;
&encrypt return TOK_ATTR_ENCRYPT;
&error_handler return TOK_ATTR_ERROR_HANDLER; &error_handler return TOK_ATTR_ERROR_HANDLER;
&expire_func return TOK_ATTR_EXPIRE_FUNC; &expire_func return TOK_ATTR_EXPIRE_FUNC;
&log return TOK_ATTR_LOG; &log return TOK_ATTR_LOG;
&mergeable return TOK_ATTR_MERGEABLE;
&optional return TOK_ATTR_OPTIONAL; &optional return TOK_ATTR_OPTIONAL;
&persistent return TOK_ATTR_PERSISTENT;
&priority return TOK_ATTR_PRIORITY; &priority return TOK_ATTR_PRIORITY;
&type_column return TOK_ATTR_TYPE_COLUMN; &type_column return TOK_ATTR_TYPE_COLUMN;
&read_expire return TOK_ATTR_EXPIRE_READ; &read_expire return TOK_ATTR_EXPIRE_READ;
&redef return TOK_ATTR_REDEF; &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; &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 @DEBUG return TOK_DEBUG; // marks input for debugger
@DIR { @DIR {