From: Mike Stepanek (mstepane) Date: Tue, 5 Nov 2019 13:45:10 +0000 (-0500) Subject: Merge pull request #1834 in SNORT/snort3 from ~KATHARVE/snort3:remove_fileclose to... X-Git-Tag: 3.0.0-264~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fe48612a223f9be9d13c9366b17d2f06293fc8b;p=thirdparty%2Fsnort3.git Merge pull request #1834 in SNORT/snort3 from ~KATHARVE/snort3:remove_fileclose to master Squashed commit of the following: commit 8ecbf015c21ae73d85da004aee4938c82742ebd5 Author: Katura Harvey Date: Mon Nov 4 15:54:16 2019 -0500 http_inspect: remove deprecated @fileclose command from test tool --- diff --git a/src/service_inspectors/http_inspect/dev_notes.txt b/src/service_inspectors/http_inspect/dev_notes.txt index 5f526a20e..e15e4e6a4 100644 --- a/src/service_inspectors/http_inspect/dev_notes.txt +++ b/src/service_inspectors/http_inspect/dev_notes.txt @@ -187,15 +187,13 @@ Commands: @partial causes a partial flush, simulating a retransmission of a detained packet @fileset specifies a file from which the tool will read data into the message buffer. This may be used to include a zipped or other binary file into a message body. Data is read - beginning at the start of the file. + beginning at the start of the file. The file is closed automatically whenever a new file is + set or there is a break command. @fileread read the specified number of bytes from the included file into the message buffer. Each read corresponds to one TCP section. @fileskip skips over the specified number of bytes in the included file. This must be a positive number. To move backward do a new fileset and skip forward from the beginning. - @fileclose resets the current file to none. Closing is done automatically whenever a new file is - set or there is a break command. An explicit close is only necessary when you want to revert - to generated fill data (see below). @ sets the test number and hence the test output file name. Applies to subsequent sections until changed. Don't reuse numbers. diff --git a/src/service_inspectors/http_inspect/http_test_input.cc b/src/service_inspectors/http_inspect/http_test_input.cc index 0f74cd312..d7a592bf4 100644 --- a/src/service_inspectors/http_inspect/http_test_input.cc +++ b/src/service_inspectors/http_inspect/http_test_input.cc @@ -278,15 +278,6 @@ void HttpTestInput::scan(uint8_t*& data, uint32_t& length, SourceId source_id, u getc(include_file[last_source_id]); } } - else if ((command_length == strlen("fileclose")) && !memcmp(command_value, - "fileclose", strlen("fileclose"))) - { - if (include_file[last_source_id] != nullptr) - { - fclose(include_file[last_source_id]); - include_file[last_source_id] = nullptr; - } - } else if (command_length > 0) { // Look for a test number