summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-11-16 17:06:36 -0800
committerJeremy Allison <jra@samba.org>2007-11-16 17:06:36 -0800
commit0cfad17e4ac727314487bed9a5f6166a6a1543eb (patch)
tree053c2ea6b8cdcfc0f0f1a5a98b71284b551c8a5d
parent1e03d348ca6f37847c9861aec90a85a586844723 (diff)
downloadsamba-0cfad17e4ac727314487bed9a5f6166a6a1543eb.tar.gz
samba-0cfad17e4ac727314487bed9a5f6166a6a1543eb.tar.bz2
samba-0cfad17e4ac727314487bed9a5f6166a6a1543eb.zip
Fix bug #4393 smbclient does not store files with zero filesize in tar-archives
from tometzky@batory.org.pl. Jeremy. (This used to be commit f3bd5e828af04f33178a66f9f332199f7d395b7b)
-rw-r--r--source3/client/clitar.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 4ce92c674d..cb7a5deddd 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -608,7 +608,6 @@ static void do_atar(char *rname,char *lname,file_info *finfo1)
SMB_BIG_UINT nread=0;
char ftype;
file_info2 finfo;
- bool close_done = False;
bool shallitime=True;
char data[65520];
int read_size = 65520;
@@ -694,7 +693,7 @@ static void do_atar(char *rname,char *lname,file_info *finfo1)
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));
@@ -733,13 +732,13 @@ static void do_atar(char *rname,char *lname,file_info *finfo1)
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 */