@ -431,7 +431,7 @@ pub fn smb2_request_record<'b>(state: &mut SMBState, r: &Smb2Record<'b>)
Some ( n ) = > { n . to_vec ( ) } ,
Some ( n ) = > { n . to_vec ( ) } ,
None = > {
None = > {
// try to find latest created file in case of chained commands
// try to find latest created file in case of chained commands
let mut guid_key = SMBCommonHdr ::from2 ( r , SMBHDR_TYPE_FILENAME ) ;
let mut guid_key = SMBCommonHdr ::from2 _notree ( r , SMBHDR_TYPE_FILENAME ) ;
if guid_key . msg_id = = 0 {
if guid_key . msg_id = = 0 {
b" <unknown> " . to_vec ( )
b" <unknown> " . to_vec ( )
} else {
} else {
@ -563,7 +563,7 @@ pub fn smb2_request_record<'b>(state: &mut SMBState, r: &Smb2Record<'b>)
SCLogDebug ! ( "create_options {:08x}" , cr . create_options ) ;
SCLogDebug ! ( "create_options {:08x}" , cr . create_options ) ;
let name_key = SMBCommonHdr ::from2 ( r , SMBHDR_TYPE_FILENAME ) ;
let name_key = SMBCommonHdr ::from2 _notree ( r , SMBHDR_TYPE_FILENAME ) ;
state . ssn2vec_map . insert ( name_key , cr . data . to_vec ( ) ) ;
state . ssn2vec_map . insert ( name_key , cr . data . to_vec ( ) ) ;
let tx_hdr = SMBCommonHdr ::from2 ( r , SMBHDR_TYPE_GENERICTX ) ;
let tx_hdr = SMBCommonHdr ::from2 ( r , SMBHDR_TYPE_GENERICTX ) ;
@ -728,7 +728,7 @@ pub fn smb2_response_record<'b>(state: &mut SMBState, r: &Smb2Record<'b>)
Ok ( ( _ , cr ) ) = > {
Ok ( ( _ , cr ) ) = > {
SCLogDebug ! ( "SMBv2: Create response => {:?}" , cr ) ;
SCLogDebug ! ( "SMBv2: Create response => {:?}" , cr ) ;
let guid_key = SMBCommonHdr ::from2 ( r , SMBHDR_TYPE_FILENAME ) ;
let guid_key = SMBCommonHdr ::from2 _notree ( r , SMBHDR_TYPE_FILENAME ) ;
if let Some ( mut p ) = state . ssn2vec_map . remove ( & guid_key ) {
if let Some ( mut p ) = state . ssn2vec_map . remove ( & guid_key ) {
p . retain ( | & i | i ! = 0x00 ) ;
p . retain ( | & i | i ! = 0x00 ) ;
state . guid2name_map . insert ( cr . guid . to_vec ( ) , p ) ;
state . guid2name_map . insert ( cr . guid . to_vec ( ) , p ) ;