can I define "static" interfaces in source/lib/interfaces.c?

Martin Zielinski mz at seh.de
Mon Feb 13 12:52:52 GMT 2006


Tomasz Chmielewski wrote:
> Martin Zielinski wrote:
> 
> (...)
> 
>> Did some tests and comparisons between an ARM smbclient and a MIPS 
>> (BE) smbclient.
>>
>> 1st thing is, that I get several compiler warnings like these:
>>
>> libsmb/clireadwrite.c:35: warning: right shift count >= width of type
>>
>> they come from code like this:
>>
>> if ((SMB_BIG_UINT)offset >> 32)   
>> where sizeof (SMB_BIG_UINT) is 4 on ARM _and_ MIPS. (On my i686 it's: 8)
>>
>> Now comes the compiler:
>> arm gcc: (0x40bd >> 32) == 0
>> mips gcc: (0x40bd >> 32) == 0x40bd (!)
>>
>> so everything after that goes wrong.
>>
>> The smbclient error can be (warning: hack) fixed, when you change the 
>> code line
>> - if ((SMB_BIG_UINT)offset >> 32)
>> with
>> + if (sizeof (SMB_BIG_UINT) > 4 && (SMB_BIG_UINT)offset >> 32)
>>
>> Perhaps, you find a more elegant way.
> 
> 
> Hmm, it didn't help in my case, still get the error (reply_write_and_X - 
> large offset (c237 << 32) used and we don't support 64 bit offsets) and 
> the files are cut to 16573 bytes :(
> 
> Any more ideas how to debug it?
> 
Hmm, starts to become difficult...
As the first chunk of data is (under normal circumstances) 16573 bytes 
in size, I still believe, that the second packet is wrong.

Please verify with ethereal, that the WriteAndX Request at offset 16573 
contains a field decoded as "High Offset". This is the error case on my 
mips system.

Then take a look at libsmb/clireadwrite.c
In function cli_issue_write the large_writex value becomes True when the 
error occurs. This shouldn't happen.

In general, the handling of potential 64 bit values seems not to be 
totally clean on 32bit-only systems. I found the problem on my mips 
board by tracking down the several defines in config.h and includes.h 
and comparing them to a working system.

Hope this helps!

Martin

-- 
Martin Zielinski             mz at seh.de
Software Development
SEH Computertechnik GmbH     www.seh.de


More information about the samba-technical mailing list