Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filestore: do not try to store a file set to nostore #10877

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/util-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,13 @@ void FileApplyTxFlags(const AppLayerTxData *txd, const uint8_t direction, File *
uint16_t update_flags = FileFlowFlagsToFlags(txd->file_flags, direction);
DEBUG_VALIDATE_BUG_ON(
(file->flags & (FILE_STORE | FILE_NOSTORE)) == (FILE_STORE | FILE_NOSTORE));
// May happen with keyword filestore:both,flow :
// There may be one opened unclosed file in one direction without filestore
// As such it has file->flags & FILE_NOSTORE
// But a new file in the other direction may trigger filestore:both,flow
// And thus set txd->file_flags & FILE_STORE
if (file->flags & FILE_NOSTORE)
update_flags &= ~FILE_STORE;
if (file->flags & FILE_STORE)
update_flags &= ~FILE_NOSTORE;

Expand Down
Loading