Bug 4046 - read_andX batch problem
Summary: read_andX batch problem
Status: NEW
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: net utility (show other bugs)
Version: 3.0.22
Hardware: x86 Linux
: P3 normal
Target Milestone: none
Assignee: Jim McDonough
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-24 02:55 UTC by lising
Modified: 2006-08-27 21:14 UTC (History)
0 users

See Also:


Attachments
four ethereal logs attached about readX batch problem. (6.10 KB, application/x-gzip)
2006-08-26 01:29 UTC, lising
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description lising 2006-08-24 02:55:45 UTC
Version: smaba-3.0.22, OS: ubuntu

When batching some other smb commands to the read_and_x command, such as close, we got error message by inspecting the log of smbd as follows:

   [2006/08/24 15:14:29, 2] smbd/process.c:switch_message(974)
    Non-SMB packet of length 64. Terminating server

We think the problem maybe inside the source tree, namely "source/smbd/process.c" line 1338:

  outsize2 = switch_message(smb_com2,inbuf2,outbuf2,size-chain_size,bufsize-chain_size);

We found the fourth parameter in the above procedure call "size-chain_size" is always smaller than "smb_size - 4", so the checking in smbd/process.c:972

   if ((strncmp(smb_base(inbuf),"\377SMB",4) != 0) || (size < (smb_size - 4))) 

will return false. Therefore, the successive andx-batch message(s) will not be processed.

   We think that maybe a problem.



                                                                 yours
                                                               lising,X2,mole
Comment 1 Jeremy Allison 2006-08-25 12:12:17 UTC
Can you attach an ethereal trace showing this please.
Jeremy.
Comment 2 lising 2006-08-26 01:29:35 UTC
Created attachment 2105 [details]
four ethereal logs attached about readX batch problem.

You can see the different reponses after the openX command. 
When I send out readX-close command as usuall, I just get the FIN response in readclose_error log.But when I add some padding to strength the packet, I can get the right response in readclose_ok log.
Also you can see the same result from the other two logs. But those are more funny, when I add some padding to the readX-echo command packet, I can just get the echo reponse rightly, and then get an unreassabled readX response.
I think samba3.0.22 source code maybe not check about the andX command batching.
Comment 3 Volker Lendecke 2006-08-27 12:03:27 UTC
Thanks for the sniffs. Just curious -- what client are you using?

Volker
Comment 4 lising 2006-08-27 21:13:48 UTC
I just wrote the simple tools myself that can send out packets as I like.  
Comment 5 lising 2006-08-27 21:14:47 UTC
We wrote the simpel tools that can send out packets as I like.