Commit Graph

172 Commits

Author SHA1 Message Date
christos 5fa7ae025c remove clauses 3, 4 2016-01-29 15:19:01 +00:00
mrg 60c6cf919b port across the change from freebsd rev 290024:
In gunzip(1), treat trailing garbage as a warning and not an error.  This
allows scripts to distinguish it between real fatal errors, for instance a
CRC mismatch.

Update manual page for the behavior change.

PR:		bin/203873
Submitted by:	Eugene Grosbein <eugen grosbein net>
MFC after:	2 weeks
2015-10-27 07:36:18 +00:00
nakayama dafd5f4472 zgrep(1): suppress the prefixing of filename on output when only
one file is specified to match the grep(1)'s output.
2015-07-06 12:05:40 +00:00
christos d6eaf99167 Coverity CID 1264915, Via FreeBSD (Xin Li)
When reading in the original file name from gzip header, we read
in PATH_MAX + 1 bytes from the file.  In r281500, strrchr() is
used to strip possible path portion of the file name to mitigate
a possible attack.  Unfortunately, strrchr() expects a buffer
that is NUL-terminated, and since we are processing potentially
untrusted data, we can not assert that be always true.

Solve this by reading in one less byte (now PATH_MAX) and
explicitly terminate the buffer after the read size with NUL.
2015-04-15 02:29:12 +00:00
wiz 75bbcb9aa1 Document xz decompression support better. From Joachim Henke on netbsd-docs. 2015-04-06 21:41:17 +00:00
mrg a1b1261ab6 do not use directory paths present in gzip files with the -N flag,
similar to the problem reported in pigz.
2015-01-13 02:37:20 +00:00
snj f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
riastradh 6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
pettai 515a14aba7 fix == compatibility problem 2013-12-06 13:33:15 +00:00
pettai 67f944d13d Add zfgrep that fell off from last update 2013-11-13 11:12:24 +00:00
pettai 54844dd551 Added zless(1) - comes in the lastest version of zmore(1) from OpenBSD
(OKed by tron@)
2013-11-12 21:58:37 +00:00
pgoyette d96eb15780 fferentiate zegrep and zfgrep by their basename only, so they can be
invoked with a pathname (ie, /usr/bin/z{e,f}grep).

OK wiz@
2013-07-25 12:25:23 +00:00
wiz a5684d07dd Use Mt for email addresses. 2013-07-20 21:39:55 +00:00
christos 22d49ff4f1 add copyright 2011-09-30 01:32:21 +00:00
joerg 7e57d8fe3f Use __printflike and __dead. 2011-08-30 23:06:00 +00:00
christos 4802a96d70 fix non-literal format strings 2011-08-17 14:07:45 +00:00
christos 90f7aa069d add noreturn atttribute. 2011-08-17 14:07:31 +00:00
joerg 09b543b065 Do proper input validation without penalizing performance. 2011-08-16 13:55:01 +00:00
christos 4a313422fa set errno on overflow return. 2011-08-16 03:25:34 +00:00
christos 5db8b1f126 provisional fix for CVS-2011-2895, buffer overflow when uncompressing 2011-08-16 03:21:47 +00:00
joerg 8cba5925cb Add a few explicit casts for sign mismatches. 2011-06-21 13:25:45 +00:00
mrg 75e42fa7da remove most of the remaining HAVE_GCC tests that are always true in
the modern world.
2011-06-20 07:43:56 +00:00
christos b3e9080143 cross reference xz.1 2011-06-19 02:22:36 +00:00
christos 9593a36e94 make this work:
- forgot to account for prelen in the input length
- deal with EOF properly
2011-06-19 02:19:45 +00:00
christos 5708f444da recognize .xz suffix 2011-06-19 02:19:09 +00:00
christos 255ae88a08 - remove unused call
- read headers separately
- print error id.
2011-06-19 01:52:28 +00:00
tsutsui 7c8d31ee49 XZ_SUPPORT requires maybe_errx(). 2011-06-19 01:20:19 +00:00
christos 40b41259f0 Add lzma (.xz) support. Somehow this does not decode after the first read yet. 2011-06-19 00:43:54 +00:00
tsutsui 784931d63b Fix OPT_LIST. -t is not available in SMALL case. 2011-03-23 12:59:44 +00:00
mrg 77a6c12f15 pull across a few changes from the freebsd folks:
http://svn.freebsd.org/changeset/base/213044
	- fixes gunzip issues
http://svn.freebsd.org/changeset/base/213927
	- fixes various typos and comments

and also an older change to add support for bzip2's "-k" option:
	don't delete the input file


thanks!
2010-11-06 21:42:32 +00:00
joerg 70729907f6 Consistently use -- for all programs called. Drop some redundant flags
for the no file argument case.
2010-04-14 20:30:28 +00:00
wiz 10b9fb64b7 Sort SEE ALSO, fix an xref. 2010-04-14 19:52:05 +00:00
joerg 68128a5628 Refactor zdiff and extend functionality to the common suffixes for bzip2
and xz.
2010-04-14 18:55:12 +00:00
mrg 59c18d14fe apply a change from Xin LI <delphij@delphij.net> to avoid problems when
reading from pipes.  introduced with the multi-part bz2 fixes.
2009-12-05 03:23:37 +00:00
mrg 5e3404f76c update version to today. 2009-10-11 09:17:21 +00:00
mrg 205ea56f45 avoid an overflow in suffix handling, from Xin LI <delphij@delphij.net>. 2009-10-11 07:09:39 +00:00
mrg 569ceba59d add "pack" uncompression support, from Xin LI <delphij@delphij.net> 2009-10-11 07:07:54 +00:00
mrg 628b55bb8d fix support for multi-section bzip2 files, as created by pbzip2. 2009-10-11 05:17:20 +00:00
lukem c1ceae17f0 Enable WARNS=4 by default for usr.bin, except for:
awk  bdes  checknr  compile_et  error  gss  hxtool  kgetcred  kinit
	klist  ldd  less  lex  locale  login  m4  man  menuc  mk_cmds
	mklocale  msgc  openssl  rpcgen  rpcinfo  sdiff  spell  ssh
	string2key  telnet  tn3270  verify_krb5_conf  xlint
2009-04-14 22:15:16 +00:00
lukem f143270c8d fix sign-compare issues 2009-04-12 10:31:14 +00:00
mrg a4a48f5384 note that -n also stops the timestamp from being output.
bump date.
2009-04-01 08:15:37 +00:00
gmcgarry 3c9a95916d Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC. 2008-08-29 00:02:21 +00:00
skrll 38af541845 WARNS=3 2008-08-03 09:25:05 +00:00
lukem 98e5374ccb Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
mrg c2b95373bf remove clause #3 from my license where there are no other
copyright holders involved.
2008-05-29 14:51:25 +00:00
wiz c75bafc005 2-clause my license. 2008-05-08 15:34:21 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
nakayama 66f1c31a47 grep "-H" option (print the filename for each match) always prints
filenames whether "-h" option (suppress filenames when multiple files
are searched) is speficied or not.

Make zgrep "-h" option actually works with using "-H" option only
when "-h" is not specified.
2008-04-27 09:27:55 +00:00
nakayama c9f8548d80 Our gzip does not have "-o" option.
So replace -o with >, then znew can now work again.
2008-04-27 09:07:13 +00:00
tls 4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry.  RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros.  Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default.  Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
2007-05-28 12:06:17 +00:00