Commit Graph

24 Commits

Author SHA1 Message Date
riastradh
0853010545 Fix some more integer overflow/truncation issues.
Arithmetic in C is hard.  Let's go shopping!
2014-01-25 15:31:06 +00:00
christos
115b322731 CID 1164169: integer overflow 2014-01-24 17:30:18 +00:00
riastradh
f13ecd80a5 Change vndcompress to use a default window size of 512.
For vnduncompress on nonseekable input, the window size is as large
as it needs to be by default, as before.  Not clear that this is the
right choice -- by default vnduncompress on nonseekable input will
just use unbounded memory unsolicited.
2014-01-22 06:18:00 +00:00
riastradh
9aa3cfafcd Rename block size option from -s' to -b'.
Makes more sense and makes it consistent with other utilities such as
pax and pigz.  This vndcompress has never gone out in a release, so
changing the name of the option shouldn't cause too many problems...
2014-01-22 06:17:25 +00:00
riastradh
7dc3ecc300 Window size is now an option; remove XXX comment to the contrary. 2014-01-22 06:16:32 +00:00
riastradh
7c5bfcbe34 Add option -w to vnd(un)compress to specify the window size. 2014-01-22 06:15:57 +00:00
riastradh
3e40e9d7d6 Implement machinery for fixed-size windows into the offset table. 2014-01-22 06:15:22 +00:00
riastradh
519e5b52f0 Write offsets in hexadecimal, not decimal. 2014-01-22 06:15:12 +00:00
riastradh
6e96c4ea68 Move block_signals/restore_sigmask to utils.c 2014-01-22 06:15:04 +00:00
riastradh
735c239796 Abstract handling of the cloop2 offset table.
Preparation for converting it to use a fixed-size window.
2014-01-22 06:14:46 +00:00
riastradh
d99bda47ef Move vndcompress utilities to utils.c. 2014-01-22 06:14:20 +00:00
riastradh
31eb87b9b9 Make partial read/write error messages more consistent in vndcompress. 2013-05-06 22:53:24 +00:00
riastradh
4b4929c1fa Add __printflike to vsnprintf_ss. 2013-05-04 15:37:39 +00:00
riz
e3748ff50d 'unsigned long' prints with %lu, not %zu. 2013-05-04 15:27:39 +00:00
riastradh
2f16fbbee5 Fix sign-compare in compress_blocks.
Not sure why my builds didn't reveal this one -- they revealed
several others during development.
2013-05-04 14:29:48 +00:00
joerg
72bd42b73b __printflike for vwarnx_ss, __dead for err_ss and errx_ss. 2013-05-04 10:21:27 +00:00
riastradh
85bbc49a09 Rewrite vndcompress to support SIGINFO and restart after interrupt.
Make it generally more robust in the process.

No objection (or comment) on tech-userlevel.

ok christos
2013-05-03 23:28:15 +00:00
joerg
505c5e5515 Use static and __dead 2011-09-06 18:45:04 +00:00
lukem
19ffb16ab2 Fix another sign-compare issue 2009-04-14 07:36:16 +00:00
lukem
49d68c2eee fix sign-compare issues 2009-04-14 07:28:23 +00:00
dyoung
4c39af2f02 Take a small step toward making vndcompress into a host tool:
remove #include <arpa/inet.h> and use bswap32() instead of ntohl().
2008-02-18 03:34:04 +00:00
he
759fbc6504 The return type from getopt(3) is int, not char. Besides, char is
not guaranteed to be signed, so comparison with -1 will cause a
warning (turned error) for some of our ports (e.g. our arm ports).
Fix this by making the 'ch' variable an int instead of a char.
2005-07-27 09:29:02 +00:00
wiz
a654b897c8 Sync usage with man page. 2005-07-25 12:25:54 +00:00
hubertf
e98029593c Add vndcompress(1) and vnduncompress(1) to transform filesystem/disk
images from "normal" into cloop2-format compressed images and back.
Written by Florian Stoehr (netbsd@wolfnode.de) with some polishing
by me.

Compressed disk images can be used with the vnd(4) driver when compiled with
VND_COMPRESSION and "vnconfig -z".  Useful for creation of Live CDs/DVDs.
2005-07-25 12:17:59 +00:00