Samba 2.0.2 (and 2.0.0) truncates/fills with NULL bytes copied files on (PR#13511)

Jeremy Allison jallison at
Mon Feb 8 17:35:15 GMT 1999

pioch at wrote:
> I've tried downloading the samba 1.9x source code to downgrade and try to reproduce the
> problem but I can't locate it anywhere on the official distribution servers. However, I
> still have an Irix SGI running samba 1.9.15p8 on the LAN which doesn't reproduce the
> problem.

The 1.9.x source is always in the old-versions directory on the ftp
site (it may be called old-source or something - just look in the
ftp directory, you'll find it :-).

> I'm using machine B (WinNT 4, Service Pack 4) to copy a file across the WAN, from
> machine A (remote WinNT 4) to machine C (Samba 2.0.x).
> Machine A is accessed across the WAN, 9000 km away.
> I've reproduced it from different machines "A", with either compressed NTFS drives or
> uncompressed.
> I've also reproduced the problem with different machines "B" running WinNT do perform
> the copy.
> In each case, machine B logs something weird in the Event Log: Either an invalid SMB
> response received from C, or:
>      Source: Rdr
>      Type: Warning
>      EventID: 3025
>      A write-behind operation has failed to the remote server %2.  The data
>      contains the amount requested to write and the amount actually written.
>      0000: 00 00 00 00 01 00 54 00   ......T.
>      0008: 00 00 00 00 d1 0b 00 80   ....Ñ..?
>      0010: 00 00 00 00 00 00 00 00   ........
>      0018: 00 00 00 00 00 00 00 00   ........
>      0020: 00 00 00 00 00 00 00 00   ........

Ok - can you reproduce this with a debug level 10 on the Samba side.
Is it reproducible with the same file on a local lan or does it only
happen over the WAN ?

If it's a WAN only problem then the problem is more likely to be
with your network, rather than Samba. The fact that NT is reporting
a write behind failure could be a bug, or a network problem (I've
seen such errors occasionally in a netbench test, but only on a
machine we know has a flakey NIC card).

> To provide a test case, I've simplified as much as I could the scenario, and I can now
> reproduce the problem with a 1231 bytes text file, "i.txt".
> I've ran smbd with debug level 10 (-d 10), and I have a 178 KB log file, in case
> anybody's interested.

Yes - so long as it's a reproducible error and the log is of the error
occurring I'm *very* interested.

> The result on the Samba server is that the text file "i.txt" has the correct size, but
> "od" shows it's filled with NULL bytes.
> This is really dramatic since it indicates Samba 2.0x cannot be trusted for file
> integrity.

Indeed and that's why I'm very interested in your problem.
Does it only happen on Solaris ? If so what compiler did you
use ? There have been a couple of strange Solaris reports
using the SUNpro CC compile (3.0.1 I believe). If this matches
your combination can you try re-compiling with gcc please.

> PS: BTW, Samba 2.0.2 announces itself on the network as "2.0.1" when using %v in the
> "Comment" field.

Get the tarball again - it was a glitch in the 2.0.1
release process I've already fixed.


	Jeremy Allison,
	Samba Team.

Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.

More information about the samba mailing list