diff options
author | Samba Release Account <samba-bugs@samba.org> | 1997-01-09 18:02:17 +0000 |
---|---|---|
committer | Samba Release Account <samba-bugs@samba.org> | 1997-01-09 18:02:17 +0000 |
commit | 03d28fa32eb094affa33133ebe2602fdb70f6361 (patch) | |
tree | 4ae66f17709d196d5c39079292e21ec4a96a438f /source/client/clitar.c | |
parent | a5b75840f2df6947fd7af2001b8a59c627327da5 (diff) | |
download | samba-03d28fa32eb094affa33133ebe2602fdb70f6361.tar.gz |
Makefile: Changes to split Solaris into Solaris2.3 and previous, and 2.4 and after from Paul Eggert.
Makefile: Added AMIGA changes from Rask Ingemann Lambertsen <rask@k4315.kampsax.dtu.dk>.
charset.c: Patch for Western European Languages from Josef Hinteregger <joehtg@joehtg.co.at>
charset.h: Patch for Western European Languages from Josef Hinteregger <joehtg@joehtg.co.at>
clitar.c: Patch to re-sync after read fail from (lost contributor name, sorry).
includes.h: Patch for AMIGA from Rask Ingemann Lambertsen <rask@k4315.kampsax.dtu.dk>
includes.h: Patch for SunOS atexit by Jeremy (jra@cygnus.com)
interface.c: Patch for AMIGA from Rask Ingemann Lambertsen <rask@k4315.kampsax.dtu.dk>
kanji.h: Patch for Western European Languages from Josef Hinteregger <joehtg@joehtg.co.at>
locking.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
locking.c: Patch to add granularity of lock files to usec by Jeremy (jra@cygnus.com)
pipes.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
proto.h: Patch to fix file locking from Jeremy (jra@cygnus.com)
reply.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
server.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
server.c: Patch for FAST_SHARE_MODE fix from (lost contributor name, sorry).
smb.h: Patch to fix file locking from Jeremy (jra@cygnus.com)
smb.h: Patch to add granularity of lock files to usec by Jeremy (jra@cygnus.com)
status.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
statuc.c: Patch to add granularity of lock files to usec by Jeremy (jra@cygnus.com)
system.c: Patch for Western European Languages from Josef Hinteregger <joehtg@joehtg.co.at>
trans2.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
trans2.c: Patch to fix volume name reported to Win95 from Jeremy (jra@cygnus.com)
util.c: Patch for Western European Languages from Josef Hinteregger <joehtg@joehtg.co.at>
util.c: Patch to fix client_name from continuously returning UNKNOWN (from various contributors).
version.h: Update to 1.9.16p10.
Diffstat (limited to 'source/client/clitar.c')
-rw-r--r-- | source/client/clitar.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/source/client/clitar.c b/source/client/clitar.c index 191e0e4dab0..cd819ad21fa 100644 --- a/source/client/clitar.c +++ b/source/client/clitar.c @@ -702,6 +702,22 @@ static BOOL ensurepath(char *fname, char *inbuf, char *outbuf) return True; } +int padit(char *buf, int bufsize, int padsize) +{ + int berr= 0; + int bytestowrite; + + DEBUG(0, ("Padding with %d zeros\n", padsize)); + memset(buf, 0, bufsize); + while( !berr && padsize > 0 ) { + bytestowrite= MIN(bufsize, padsize); + berr = dotarbuf(tarhandle, buf, bytestowrite) != bytestowrite; + padsize -= bytestowrite; + } + + return berr; +} + /* * smbclient functions */ @@ -1033,7 +1049,15 @@ static void do_atar(char *rname,char *lname,file_info *finfo1) dataptr=NULL; datalen=0; } - + + /* pad tar file with zero's if we couldn't get entire file */ + if (nread < finfo.size) + { + DEBUG(0, ("Didn't get entire file. size=%d, nread=%d\n", finfo.size, nread)); + if (padit(inbuf, BUFFER_SIZE, finfo.size - nread)) + DEBUG(0,("Error writing local file\n")); + } + /* round tar file to nearest block */ if (finfo.size % TBLOCK) dozerobuf(tarhandle, TBLOCK - (finfo.size % TBLOCK)); @@ -1681,17 +1705,15 @@ int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind) return 0; } + tar_excl=tar_clipfl!='X'; + if (Optind+1<argc) { + cliplist=argv+Optind+1; + clipn=argc-Optind-1; + } if (Optind>=argc || !strcmp(argv[Optind], "-")) { /* Sets tar handle to either 0 or 1, as appropriate */ tarhandle=(tar_type=='c'); } else { - tar_excl=tar_clipfl!='X'; - - if (Optind+1<argc) { - cliplist=argv+Optind+1; - clipn=argc-Optind-1; - } - if ((tar_type=='x' && (tarhandle = open(argv[Optind], O_RDONLY)) == -1) || (tar_type=='c' && (tarhandle=creat(argv[Optind], 0644)) < 0)) { |