diff -urNP samba-3.0.27.orig/source/client/clitar.c samba-3.0.27/source/client/clitar.c --- samba-3.0.27.orig/source/client/clitar.c 2007-11-15 04:15:03.000000000 +0100 +++ samba-3.0.27/source/client/clitar.c 2007-11-16 10:32:54.000000000 +0100 @@ -609,7 +609,6 @@ SMB_BIG_UINT nread=0; char ftype; file_info2 finfo; - BOOL close_done = False; BOOL shallitime=True; char data[65520]; int read_size = 65520; @@ -695,7 +694,7 @@ DEBUG(3,("getting file %s of size %.0f bytes as a tar file %s", finfo.name, (double)finfo.size, lname)); - while (nread < finfo.size && !close_done) { + do { DEBUG(3,("nread=%.0f\n",(double)nread)); @@ -734,13 +733,13 @@ break; } - if (datalen == 0) { + if ( (datalen == 0) && (finfo.size != 0) ) { DEBUG(0,("Error reading file %s. Got 0 bytes\n", rname)); break; } datalen=0; - } + } while ( nread < finfo.size ); if (wrote_tar_header) { /* pad tar file with zero's if we couldn't get entire file */