summaryrefslogtreecommitdiff
path: root/usr.bin/compress
AgeCommit message (Collapse)Author
2022-03-14add -k flag to gzip and gunzipSolene Rapenne
When using this flag, the input file is kept after compression or decompression, this makes our gzip more compatible with the other gzip changes reworked by jca@, thanks ok jca@ millert@
2021-01-18Move definition of pmode to main.c instead of a compress.h. Avoids linkermortimer
issues with -fno-common. ok deraadt@
2020-10-12Accommodate POSIX basename(3) that takes a non-const parameter andChristian Weisgerber
may modify the string buffer. ok millert@
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2019-05-27For "gunzip -N", only use the basename of the stored path.Todd C. Miller
Fixes a directory traversal bug when the stored name includes a directory component. Both GNU gzip and our gzip store the basename of the path when compressing but a malicious .gz file could contain an arbitrary path. Problem found by elvis alien. OK deraadt@
2019-01-25I am retiring my old email address; replace it with my OpenBSD one.Todd C. Miller
2017-05-29Remove unused zclose function.Frederic Cambus
From Brian Callahan, thanks! OK tb@
2016-09-03remove parens from method callsTed Unangst
2016-09-03the SMALL code made a half hearted effort to exclude compression codeTed Unangst
but some of the write code remained. shuffle things around a bit to make the exclusion more complete.
2016-09-03start pulling apart some function pointers that take too many parametersTed Unangst
because of excessive code sharing. compression and decompression are not entirely similar, they should share less. ok joerg millert
2016-08-17When returning the file size info, only use z_total_in/z_total_outTodd C. Miller
for the read (inflate) case where there might be multiple streams. For the write (deflate) case there can only be a single stream so just use the per-stream total_in/total_out. Fixes "gzip -v" byte counts. OK henning@.
2016-07-14make several program to use "chown" promise.Sebastien Marie
it allows chown(2) call to change the user or group on a file. - usr.bin/compress : aka gzip - usr.bin/mg : open a file for writing - usr.bin/sed : inplace editing - usr.bin/sort : if outfile equals one of the input files ok deraadt@ tb@ (and a reminder from Remi Locherer) warning: in order to use it, you must have a recent kernel with the new promise.
2016-04-29Need to set in/out bytes count for gz_write too. Otherwise gzipTodd C. Miller
will think the resulting file was got larger during compression.
2016-04-28Account for multiple streams in "gzip -l" output. This fixes "gzipTodd C. Miller
-l" output when used on package files. OK espie@ deraadt@
2016-03-30for some time now mandoc has not required MLINKS to functionJason McIntyre
correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
2015-10-17Tighten pledge: We only write to stdio and never to any files ifChristian Weisgerber
in cat mode (-c, zcat), or in test mode (-t), or if there are no file arguments and there is no -o outfile. Due to fts(3) we require rpath even for compress <in >out. "seems sound" deraadt@
2015-10-09Change all tame callers to namechange to pledge(2).Theo de Raadt
2015-10-04Also needs "rpath" for some circumstances.Theo de Raadt
2015-10-03gzip can use tame "stdio wpath cpath fattr". this blocks a lot ofTheo de Raadt
system behaviours such as forking, execve, sockets, etc. in theory this extended by parsing the arguments first, and creating the whitepathlist. the pathlist probably needs to be directory-oriented, rather than exact path of files, because a gzip file may specify the filename it wants (and that won't be available until it is opened, and partially parsed). anyone want to give this a try? gzip was an early goal for capsicum. who is running a capsicum gzip?
2015-08-30Ignore setuid/setgid settings from a compress/gzip file; original CSRGTheo de Raadt
code. Found by trondd exercising coverage of tame in gzip. ok guenther millert kettenis
2015-08-20Do not cast result of malloc/calloc/realloc* if stdlib.h is in scopeTheo de Raadt
ok krw millert
2015-06-25Put fts_close() where missing.Masao Uebayashi
Not bugs in short-lived commands that call exit() -> _exit() immediately, but for idempotency. Originally found in ls(1) by Valgrind. Changes for other commands are from deraadt@. Reviewed by me, tested in snapshots. OK deraadt@
2015-05-03Preserve times to nanosecond precision instead of just microsecond.Philip Guenther
Prefer to set attributes by fd for regular files, and not follwing symlinks for others. ok brynet@ millert@
2015-04-09Both more and less accept options beginning with '+'.Todd C. Miller
From Tim van der Molen
2015-02-01KNF whitespace fix and handle funopen error case.Tobias Stoeckmann
ok millert
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers whereTheo de Raadt
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-10-08userland reallocarray audit.Doug Hogan
Replace malloc() and realloc() calls that may have integer overflow in the multiplication of the arguments with reallocarray(). ok deraadt@
2014-10-07no more Xr to gzsigTheo de Raadt
2014-05-08+.Xr less 1 ,Jason McIntyre
2014-05-07When you want more, you say "more". When you want less, you say "less".Vadim Zhukov
When you don't get what you asked for, you get angry. When you add a tiny bit, it should be "more" or "less" still, or you'll get angry. So lets make zmore(1) call more(1) and zless(1) call less(1), as it's supposed to be. okay and input from ingo@, no objections from author AKA millert@
2014-03-17use Ex;Jason McIntyre
2014-01-28make description of gzip(1) exit status codes more accurate.Igor Sobrado
issue pointed out by jmc@, verified by me. ok jmc@
2014-01-28make it clear that -LV are no ops; ok millertJason McIntyre
2014-01-27Remove the no-op flags -L and -V from compress(1), these optionsTodd C. Miller
come from GNU zip and they were never in compress(1) until we added gzip(1) support to it. Also remove -g flag from gzip(1) as it is non-standard and only makes sense in compress(1). Joint work with jmc@ and sobrado@. OK jmc@, sobrado@
2014-01-27remove the no-op flags -L and -V from compress(1), these optionsIgor Sobrado
come from GNU zip and they were never in compress(1) until we added gzip(1) support to it. joint work with jmc@ and millert@; millert@ will do the rest. ok jmc@, millert@
2014-01-26- document for uncompress and zcat exit status of 0 or >0 onlyJason McIntyre
- kill an unneccessary Pp that created double vertical space - mention that posix marks these apps xsi - add uncompress -V to the list of extensions - document that posix stipulates a limit of 14 for -b, even though it permits 15 and 16 ok sobrado millert
2013-12-29+.Sh EXIT STATUSJason McIntyre
2013-08-12some minor fixes; From: Jan StaryJason McIntyre
2013-04-17zlib info header is 32-bit; handle for localtime() call; ok millertTheo de Raadt
2012-09-30When outputting to stdout and compressing would grow the file, exitTodd C. Miller
normally instead of with a value of 2. Also avoids unlinking the file "stdout" in the current directory in this case. OK miod@ sthen@ henning@ beck@
2012-09-26last stage of rfc changes, using consistent Rs/Re blocks, and moving theJason McIntyre
references into a STANDARDS section;
2012-08-21flesh out the rfc sections;Jason McIntyre
2011-09-22Remove the rcsid which were intentionally skipped in the "purge of 2009"Theo de Raadt
because the -V command printed them... gut the -V (and -L, while there) to be silent. ok miod jsg
2011-03-05Fix potential crash when GZIP variable set and more than 512 commandTodd C. Miller
line args specified. Closes PR 6573. OK deraadt@
2010-09-03add an EXIT STATUS section for /usr/bin;Jason McIntyre
2010-07-28Truncate output file when compressing. OK deraadt@Todd C. Miller
2010-07-22document exit returns; from daniel dickmanJason McIntyre
2010-07-01if you want usenet archives from 1985, you'll have to look elsewhereTed Unangst
2010-03-27remove irrelevant man page; ok deraadtJason McIntyre
2010-03-26dispense with some wacky escape sequences;Jason McIntyre