From bd9a42fa8df5eb37af9f23ff4498c4747f084131 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 16 Jul 2003 00:13:40 +0000 Subject: Fix from Dragan Krnic for handling files in tar archives > 8GB. Fixes bug 102. (This used to be commit b54183a7b23d1046faad0890de3fdda3df0fec88) --- source3/client/clitar.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); -- cgit