Commit Graph

74 Commits

Author SHA1 Message Date
Xin LI
64093e14eb Use printable ASCII instead of octal representation.
MFC after:	2 weeks
2016-08-27 00:56:37 +00:00
Marcelo Araujo
d61c7fc026 Use nitems() from sys/param.h.
MFC after:	2 weeks.
Sponsored by:	gandi.net (BSD Day Taiwan)
2016-07-30 07:02:33 +00:00
Enji Cooper
430f7286a5 Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed
after r298107

Summary of changes:

- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that
  namespacing is kept with FILES appropriately, and that this shouldn't need
  to be repeated if the namespace changes -- only the definition of PACKAGE
  needs to be changed
- Allow PACKAGE to be overridden by callers instead of forcing it to always be
  `tests`. In the event we get to the point where things can be split up
  enough in the base system, it would make more sense to group the tests
  with the blocks they're a part of, e.g. byacc with byacc-tests, etc
- Remove PACKAGE definitions where possible, i.e. where FILES wasn't used
  previously.
- Remove unnecessary TESTSPACKAGE definitions; this has been elided into
  bsd.tests.mk
- Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES;
  ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk.
- Fix installation of files under data/ subdirectories in lib/libc/tests/hash
  and lib/libc/tests/net/getaddrinfo
- Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)

Document the proposed changes in share/examples/tests/tests/... via examples
so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of
replacing FILES. share/mk/bsd.README didn't seem like the appropriate method
of communicating that info.

MFC after: never probably
X-MFC with: r298107
PR: 209114
Relnotes: yes
Tested with: buildworld, installworld, checkworld; buildworld, packageworld
Sponsored by: EMC / Isilon Storage Division
2016-05-04 23:20:53 +00:00
Glen Barber
7d536dc855 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-10 21:16:01 +00:00
Bryan Drewery
15c433351f DIRDEPS_BUILD: Connect MK_TESTS.
Sponsored by:	EMC / Isilon Storage Division
2016-03-09 22:46:01 +00:00
Glen Barber
43faedc133 First pass to fix the 'tests' packages.
Sponsored by:	The FreeBSD Foundation
2016-02-02 22:26:49 +00:00
Xin LI
199c446625 Update NetBSD RCS IDs to reflect the changes being upstreamed.
MFC after:	13 days
X-MFC-With:	r290024
2015-10-27 21:26:05 +00:00
Xin LI
354ed04257 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-26 22:29:58 +00:00
Enji Cooper
b2d48be1bc Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)

- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Divison
2015-10-12 08:16:03 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Xin LI
dec32474f0 r281540 was upstreamed as NetBSD r1.108 of gzip.c, note it as merged. 2015-04-16 22:30:57 +00:00
Xin LI
c1c4677aec 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.

Reported by:	Coverity
CID:		1264915
X-MFC-with:	281500
MFC after:	13 days
2015-04-15 00:07:21 +00:00
Xin LI
0eeac58930 Sync with NetBSD:
- Mention xz(1) in gzip(1).
 - Strip away path from header name when decompressing.

MFC after:	2 weeks
2015-04-13 19:46:30 +00:00
Jilles Tjoelker
d6b3ef634c compress,gzip,xz: Preserve timestamps with nanosecond precision. 2015-02-17 13:12:54 +00:00
Baptiste Daroussin
3e11bd9e2a Convert to usr.bin/ to LIBADD
Reduce overlinking
2014-11-25 14:29:10 +00:00
Simon J. Gerraty
9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Xin LI
060ea80ecb Sync with NetBSD.
MFC after:	2 weeks
2014-10-23 01:22:29 +00:00
Enji Cooper
cdfd89cea1 Integrate usr.bin/gzip/tests from NetBSD into atf/kyua
Sponsored by: EMC / Isilon Storage Division
2014-10-09 02:24:34 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Xin LI
60e5655540 Correct buffer size.
Submitted by:	Sascha Wildner <swildner dragonflybsd org>
MFC after:	2 weeks
2014-06-26 00:31:58 +00:00
Baptiste Daroussin
2b7af31cf5 use .Mt to mark up email addresses consistently (part3)
PR:		191174
Submitted by:	Franco Fichtner  <franco at lastsummer.de>
2014-06-23 08:23:05 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
cc3f4b9965 Merge from head 2014-05-08 23:54:15 +00:00
Warner Losh
c6063d0da8 Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.
2014-05-06 04:22:01 +00:00
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Simon J. Gerraty
23090366f7 Sync from head 2012-11-04 02:52:03 +00:00
Ed Schouten
bf70becee6 More -Wmissing-variable-declarations fixes.
In addition to adding `static' where possible:

- bin/date: Move `retval' into extern.h to make it visible to date.c.
- bin/ed: Move globally used variables into ed.h.
- sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings.
- usr.bin/calendar: Remove unneeded variables.
- usr.bin/chat: Make `line' local instead of global.
- usr.bin/elfdump: Comment out unneeded function.
- usr.bin/rlogin: Use _Noreturn instead of __dead2.
- usr.bin/tset: Pull `Ospeed' into extern.h.
- usr.sbin/mfiutil: Put global variables in mfiutil.h.
- usr.sbin/pkg: Remove unused `os_corres'.
- usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
2012-10-19 14:49:42 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Eitan Adler
3e0efd2ec4 Fix style nit: don't use leading zero for dates in .Dd
Prompted by:	brueffer
Approved by:	brueffer
MFC after:	3 days
2012-06-05 03:14:39 +00:00
Xin LI
d9b3a15b37 According to the NetBSD foundation [1]:
Third parties are encouraged to change the license on any files which have
a 4-clause license contributed to the NetBSD Foundation to a 2-clause
license. We would also encourage you to inform us about these files, so
that we can continue to track the many places in which NetBSD is used.

http://www.netbsd.org/about/redistribution.html#why2clause [1]

Requested by:	joel@
2011-10-16 07:35:26 +00:00
Xin LI
140c037a0c Incorporate recent changes from NetBSD. Most notable change is the addition
of support of decompressing xz files.

Obtained from:	NetBSD
2011-10-10 06:37:32 +00:00
Xin LI
f13a03d89e Sync RCS id with NetBSD, this was intentionally omitted from the advisory
in order to reduce patchset size.

MFC after:	3 days
2011-09-28 18:03:53 +00:00
Bjoern A. Zeeb
a06534c3c2 Fix handling of corrupt compress(1)ed data. [11:04]
Add missing length checks on unix socket addresses. [11:05]

Approved by:	so (cperciva)
Approved by:	re (kensmith)
Security:	FreeBSD-SA-11:04.compress
Security:	CVE-2011-2895 [11:04]
Security:	FreeBSD-SA-11:05.unix
2011-09-28 08:47:17 +00:00
Xin LI
5106ce89d0 Fix a regression introduced with previous changeset: if output is stdout,
do not check for symbolic link.
2011-05-25 18:04:11 +00:00
Xin LI
fc26891004 Match symbolic link handling behavior with GNU gzip, bzip2 and xz:
When we are operating on a symbolic link pointing to an existing
file, bail out by default, but go ahead if -f is specified.

Submitted by:	arundel
MFC after:	2 weeks
2011-05-23 09:40:21 +00:00
Xin LI
be07528c53 Diff reduction against NetBSD. The most notable change is to zdiff(1) to
handle more file formats including bzip2 and xz.

MFC after:	2 weeks
2011-05-23 09:02:44 +00:00
Glen Barber
252b39bfa2 Update manpage to remove CRT reference.
PR:		154441
Submitted by:	Ben Haga (bhaga of absoludicrous com)
Suggestion by:	pluknet
Approved by:	keramida (mentor)
MFC after:	3 days
2011-02-07 22:33:39 +00:00
Benedict Reuschling
c4fadc2b78 Correct some typos in comments, no functional changes. 2010-10-16 15:24:04 +00:00
Xin LI
fb2924e4ac In the past gunzip(1) write()'s after each inflate return. This is
not optimal from a performance standpoint since the write buffer is
not necessarily be filled up when the inflate rountine reached the
end of input buffer and it's not the end of file.

This problem gets uncovered by trying to pipe gunzip -c output to
a GEOM device directly, which enforces the writes be multiple of
sector size.

Sponsored by:	iXsystems, Inc.
Reported by:	jpaetzel
MFC after:	2 weeks
2010-09-23 01:24:33 +00:00
Xin LI
c38fa7e016 Check return value of dup(), it could be -1 when the system is running
out of file descriptors for instance.

Found with:	Coverity Prevent(tm)
CID:		6084
MFC after:	1 month
2010-08-19 01:34:00 +00:00
Xin LI
08b300a1b7 Several style fixes as prompted by bde@.
While I'm there, loosen the st_nlink check and fix grammar for 1 extra
links.
2010-06-10 20:59:28 +00:00
Xin LI
1371ad1594 Follow up revision 208888 with purely ident changes.
MFC after:	1 week
2010-06-07 10:10:44 +00:00
Xin LI
09e979e915 Correct a bug in gzip(1): make sure that initialize isb with fstat() on
input file before using it.

PR:		bin/147275
Submitted by:	thomas
MFC after:	1 week
2010-06-07 10:09:40 +00:00
Xin LI
637bfa488b Use _exit(2) system call directly instead of using exit(3) in signal
handler, as the latter is not guaranteed to be signal safe, and we
do not really care about flushing the stream during SIGINT.

Suggested by:	Maxim Konovalov <maxim.konovalov gmail com>
MFC after:	13 days
2010-04-27 17:57:04 +00:00
Xin LI
1edd4fcd23 Language improvements to make the BUGS section easier to read.
Reviewed by:	Alexander Best <alexbestms wwu de>
MFC after:	13 days
2010-04-27 17:50:43 +00:00
Xin LI
18333f544e Add a signal handler for SIGINT which removes output file when necessary.
While I'm there, move unlink_input() slightly down to after closing the
output file, in uncompression path.

MFC after:	2 weeks
2010-04-26 20:05:48 +00:00