Commit Graph

21 Commits

Author SHA1 Message Date
Alexey Tourbin
72ad101add 4.0.4-alt113
- Implemented limited support for large files: a 2GB+ file can now be packaged,
  but the total size of uncompressed cpio payload is capped at 4 GB.
- Automatically downgrade LZMA compression levels 7-9 -> 6 on small payloads.
2018-06-26 13:03:42 +03:00
Alexey Tourbin
e854592c75 rpmio.c: updated lzma compression set-up 2018-06-26 12:42:44 +03:00
Alexey Tourbin
a1a075caa2 rpmio: fixed Fwrite() truncated return value
This is the reason why files >= 2G could not be added to cpio, even on
64-bit architectures.  Fwrite was called with a buffer >= 2G, but the
return value was truncated to int (this narrowing conversion is probably
undefined behavior already; what happens next, though, is that after
casting to size_t it assumes a very big numeric value of >= 2^64-2^32).
So rpmbuild was failing with an unrelated errno, "cpio: write failed -
Bad file descriptor".

There are other reasons why this still won't work on 32-bit architectures.
For one, rpmbuild mmaps a file before feeding it to cpio, and 32-bit
architectures have a very limited ability, if any, to mmap 2G+ files.
2018-06-26 12:42:44 +03:00
96a5445b98 Drop bzdio support
There is no use in supporting bzip2 compressed payloads in rpmbuild nowadays.
2017-11-20 01:42:20 +00:00
9515fd6545 rpmio: fix potential buffer overflow in Fdopen
In file included from /usr/include/string.h:648:0,
                 from ../system.h:76,
                 from rpmio.c:6:
In function 'strncat',
    inlined from 'Fdopen' at rpmio.c:3473:5:
/usr/include/bits/string3.h:158:10: warning: call to __builtin___strncat_chk might overflow destination buffer
   return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
2017-01-17 16:16:28 +03:00
4ab56b3647 rpmio: fix potential buffer overflow in Fdopen
In file included from /usr/include/string.h:648:0,
                 from ../system.h:76,
                 from rpmio.c:6:
In function 'strncat',
    inlined from 'Fdopen' at rpmio.c:3473:5:
/usr/include/bits/string3.h:158:10: warning: call to __builtin___strncat_chk might overflow destination buffer
   return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
2017-01-14 13:42:53 +00:00
Gleb Fotengauer-Malinovskiy
91210177c1 Make rpm2cpio exit code accurate for large packages
Grab the uncompressed payload size from header and compare number of
bytes copied to that for exit code.  Previously, truncated payloads could
have returned with success.  This also fixes the exit code for large
payloads.
2015-11-18 20:52:46 +03:00
4efd5e5f44 Fix some harmless compilation warnings 2014-02-15 22:44:35 +00:00
Alexey Tourbin
147801d6a6 rpmio.c: tweak lzma preset options for better compression 2009-09-26 02:47:34 +04:00
Alexey Tourbin
0cded3969f rpmio.c: updated lzdio for xz-5.0 API, added xzdio 2009-09-24 12:30:07 +04:00
Alexey Tourbin
52b2499aff rpmio.c: implemented cpio hints for rsyncable_gzwrite() 2008-05-30 22:23:16 +04:00
Alexey Tourbin
8d5e355e06 rpmio.c: deal with partial rsyncable_gzwrite() return 2008-05-30 20:09:17 +04:00
Alexey Tourbin
f7b5ee1e80 rpmio.c: implemented rscynable_gzwrite() 2008-05-30 20:08:14 +04:00
Alexey Tourbin
c761902bcb rpmio.c: introduced rpmGZFILE wrapper for gzdio 2008-05-30 20:05:08 +04:00
Panu Matilainen
86679b599f Plug a memleak in lzclose() 2008-05-24 13:48:14 +04:00
Alexey Tourbin
9814453966 backported LZMA payload compression from SuSE 2008-05-24 13:47:41 +04:00
8787ee5d55 Fixed "type qualifiers ignored on function return type" issue. 2006-05-15 02:48:59 +04:00
906d5c74b2 fixed gzclose error handling 2003-05-06 15:09:48 +00:00
6cc64fa4ea updated code to snapshot 2002-06-15 of 4_0 branch 2002-08-03 16:35:14 +00:00
dee952c2f8 sync with rpm4 branch: include local headers 2002-03-25 22:02:39 +00:00
82a4763c66 Initial revision 2002-03-25 20:16:26 +00:00