tango icon indicating copy to clipboard operation
tango copied to clipboard

I can only access some folders on my linux server

Open qiulang opened this issue 13 years ago • 6 comments

Hi I hit this weird error on my linux server(using samba service of course) that I can access some directories under the same directory while others gave me the error message, "_tango_evaluate_response_header(): NT_STATUS Level is 0003 with value 000d." Can you take a look ? Thanks!

_tango_send(): Bytes to send (including nbt-header!): 95 _tango_send(): Sent 95 bytes. _tango_send_and_receive(): Received 4 bytes. _tango_send_and_receive(): Received 35 bytes. _tango_TRANS2_FIND_FIRST2(): Received response _tango_evaluate_response_header(): NT_STATUS Level is 0003 with value 000d.

qiulang avatar Nov 21 '11 08:11 qiulang

Hi qiulang, 0003=Error 000d=Invalid Paramter Sadly a rather generic error.

Can you boil the problem down to some specific file? Maybe try to successively remove file from the folder to find out which file/folder might be the problem; special characters?

Thanks, Daniel

38leinaD avatar Nov 21 '11 20:11 38leinaD

Hi, some further information. First I find that if that folder name contains "." or " ", it may not work. For example I originally had a folder called "expect5.45", I got the error, after I changed it to "expect545" I can list folder then. But the weird thing is that if I change the folder name to "expect5.45 -1" it works as well and there has to be a space in the folder name, if it is "expect5.45-1", I still got the error.

Second, the length of file name seems to cause the problem as well. If the name is more than 11 letters, I will got the error, e.g. "expect54500" is ok but "expect545000" is not. But again the weird thing is that I changed the folder name to "expect", I got the error; if it is "expect5", I can list folder again.

I open the VERY_VERBOSE macro, if you need I can attached the log.

qiulang avatar Nov 22 '11 05:11 qiulang

Hi, I seem to find the pattern of the failed file name!

It seems that if the name's length is an odd number the access will succeed; but if the length is an even number the access will fail!

qiulang avatar Nov 22 '11 10:11 qiulang

Hi I found a way to fix the problem although I don’t know the root cause of the problem!

So as I found current codes only work for the folder whose name’s length is odd number. Then I further found that it may be because for even number folder name, the data size we set in _tango_TRANS2_FIND_FIRST2 is incorrect!

Say I have a folder called “abc” and another folder called “abcd”, when I turn on the macro VERY_VERBOSE I find that they both print out log “Bytes to send (including nbt-header!): 89″, apparently for “abcd” folder the bytes to send should be 90. So I add this line to correct data size and codes work now!

if (data_offset % 2 == 0) _tango_smb_setDataSize(smb, data_offset+1);

But I examine your code carefully and can’t find out why we need to +1 for even number.

So any idea?

qiulang avatar Nov 24 '11 08:11 qiulang

the "specification" is rather unclear on where paddings are required. As you see, i also do some paddings to word boundaries for the trans2_find_first SMB. So, in general it is not surprising that for folder names with length x and length x+1 bytes, actually a message with the same size is sent out.

The only way to really find out about what is "right" or "wrong" is comparing with what over cifs clients send. So, if your fix works, it might as well be that i am missing some padding somewhere.

I will have a check on this once i have access to a windows or samba server for testing again.

38leinaD avatar Nov 25 '11 20:11 38leinaD

Great work man!!! I followed the fix from qiulang and everything is working amazingly! Now if you could make it to talk to MTLM2 then it is perfect.

rfcongithub avatar Jan 26 '12 01:01 rfcongithub