summaryrefslogtreecommitdiffstats
path: root/source/client/clitar.c
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
commitb54183a7b23d1046faad0890de3fdda3df0fec88 (patch)
tree62a6cbf381aea95a4795d10a386e78b34f488e38 /source/client/clitar.c
parentc390b3e4cd68cfc233ddf14d139e25d40f050f27 (diff)
downloadsamba-b54183a7b23d1046faad0890de3fdda3df0fec88.tar.gz
samba-b54183a7b23d1046faad0890de3fdda3df0fec88.tar.xz
samba-b54183a7b23d1046faad0890de3fdda3df0fec88.zip
Fix from Dragan Krnic for handling files in tar archives > 8GB.
Fixes bug 102.
Diffstat (limited to 'source/client/clitar.c')
-rw-r--r--source/client/clitar.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/client/clitar.c b/source/client/clitar.c
index 2ef2832e504..765bc2a6594 100644
--- a/source/client/clitar.c
+++ b/source/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);