summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-07-16 00:13:40 +0000
committerTim Potter <tpot@samba.org>2003-07-16 00:13:40 +0000
commitbd9a42fa8df5eb37af9f23ff4498c4747f084131 (patch)
tree6e7addfaf65b5771b0442cb24a214e7f2b8b69b1 /source3/client
parentc44a9d25a2bfff9d5ebede80f30e13e41aca797c (diff)
downloadsamba-bd9a42fa8df5eb37af9f23ff4498c4747f084131.tar.gz
samba-bd9a42fa8df5eb37af9f23ff4498c4747f084131.tar.bz2
samba-bd9a42fa8df5eb37af9f23ff4498c4747f084131.zip
Fix from Dragan Krnic for handling files in tar archives > 8GB.
Fixes bug 102. (This used to be commit b54183a7b23d1046faad0890de3fdda3df0fec88)
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/clitar.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 2ef2832e50..765bc2a659 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -206,6 +206,16 @@ static void writetarheader(int f, const char *aname, SMB_BIG_UINT size, time_t m
oct_it((SMB_BIG_UINT)0, 8, hb.dbuf.uid);
oct_it((SMB_BIG_UINT)0, 8, hb.dbuf.gid);
oct_it((SMB_BIG_UINT) size, 13, hb.dbuf.size);
+ if (size > (SMB_BIG_UINT)077777777777LL) {
+
+ /* This is a non-POSIX compatible extention to store files
+ greater than 8GB. */
+
+ memset(hb.dbuf.size, 0, 4);
+ hb.dbuf.size[0]=128;
+ for (i = 8, jp=(char*)&size; i; i--)
+ hb.dbuf.size[i+3] = *(jp++);
+ }
oct_it((SMB_BIG_UINT) mtime, 13, hb.dbuf.mtime);
memcpy(hb.dbuf.chksum, " ", sizeof(hb.dbuf.chksum));
memset(hb.dbuf.linkname, 0, NAMSIZ);