1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-08 04:58:40 +03:00

Fix from Dragan Krnic for handling files in tar archives > 8GB.

Fixes bug 102.
(This used to be commit b54183a7b23d1046faad0890de3fdda3df0fec88)
This commit is contained in:
Tim Potter 2003-07-16 00:13:40 +00:00
parent c44a9d25a2
commit bd9a42fa8d

View File

@ -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);