]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1834 in SNORT/snort3 from ~KATHARVE/snort3:remove_fileclose to...
authorMike Stepanek (mstepane) <mstepane@cisco.com>
Tue, 5 Nov 2019 13:45:10 +0000 (08:45 -0500)
committerMike Stepanek (mstepane) <mstepane@cisco.com>
Tue, 5 Nov 2019 13:45:10 +0000 (08:45 -0500)
Squashed commit of the following:

commit 8ecbf015c21ae73d85da004aee4938c82742ebd5
Author: Katura Harvey <katharve@cisco.com>
Date:   Mon Nov 4 15:54:16 2019 -0500

    http_inspect: remove deprecated @fileclose command from test tool

src/service_inspectors/http_inspect/dev_notes.txt
src/service_inspectors/http_inspect/http_test_input.cc

index 5f526a20e9cc51a36179a991091c242e3d400988..e15e4e6a4374398b94f712c60473631d4ea01d55 100644 (file)
@@ -187,15 +187,13 @@ Commands:
   @partial causes a partial flush, simulating a retransmission of a detained packet
   @fileset <pathname> 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 <decimal number> read the specified number of bytes from the included file into the
      message buffer. Each read corresponds to one TCP section.
   @fileskip <decimal number> 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).
   @<decimal number> sets the test number and hence the test output file name. Applies to subsequent
      sections until changed. Don't reuse numbers.
 
index 0f74cd312b9b2c8ede08cbb46b68a3ecd8924e54..d7a592bf45dfb753bda212dc335bd24055a1536c 100644 (file)
@@ -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