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 #9996

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 @@ -297,6 +297,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
Comment on lines +300 to +304
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we store file flags per direction?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this was removed by 79499e4, so this should be another bug/ticket...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created this: https://redmine.openinfosecfoundation.org/issues/6617
Please set the version, assignee etc as you see fit. Thank you :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reworded the title.
Would you want to create a S-V test for it ?
using filestore:to_server,flow; and checking that files to_client do not get stored ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (file->flags & FILE_NOSTORE)
update_flags &= ~FILE_STORE;
if (file->flags & FILE_STORE)
update_flags &= ~FILE_NOSTORE;

Expand Down
Loading