By setting the flags as for the filename keyword (not sticky version)
{
if (DetectBufferSetActiveList(s, g_file_name_buffer_id) < 0)
return -1;
+ s->file_flags |= (FILE_SIG_NEED_FILE | FILE_SIG_NEED_FILENAME);
return 0;
}
UtRegisterTest("DetectFilenameTestParse02", DetectFilenameTestParse02);
UtRegisterTest("DetectFilenameTestParse03", DetectFilenameTestParse03);
}
-#endif /* UNITTESTS */
\ No newline at end of file
+#endif /* UNITTESTS */
"support file matching", AppProtoToString(s->alproto));
SCReturnInt(0);
}
+ if (s->alproto == ALPROTO_HTTP2 && (s->file_flags & FILE_SIG_NEED_FILENAME)) {
+ SCLogError(SC_ERR_NO_FILES_FOR_PROTOCOL,
+ "protocol HTTP2 doesn't support file name matching");
+ SCReturnInt(0);
+ }
if (s->alproto == ALPROTO_HTTP) {
AppLayerHtpNeedFileInspection();