Commit Graph

12429 Commits

Author SHA1 Message Date
John Baldwin
c77547d2f9 Include command line arguments in core dump process info.
Fill in pr_psargs in the NT_PRSINFO ELF core dump note with command
line arguments.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D7116
2016-07-14 23:20:05 +00:00
Pedro F. Giffuni
20a50e9ca9 mail(1): check for out of memory conditions when calling calloc(3).
X-MFC with:	r302771
2016-07-14 15:09:08 +00:00
Andrey A. Chernov
c4c8ae8b87 Optimize [Cc]flag case: don't repeatedly add the last character of
string2 to squeeze cset when string2 reach its EOS state.
2016-07-14 09:26:53 +00:00
Andrey A. Chernov
4573d5012b Document incomplete support of [=equiv=] and collation for ranges. 2016-07-14 09:24:55 +00:00
Andrey A. Chernov
5b4fa425ba Back out non-collating [a-z] ranges (r302594).
Instead of changing the whole course to another POSIX-permitted way
for consistency and uniformity I decide to completely ignore missing
regex fucntionality and focus on fixing bugs in what we have now,
too many small obstacles we have choicing other way, counting ports.
Corresponding libc changes are backed out in r302824.
2016-07-14 09:19:53 +00:00
Pedro F. Giffuni
92fa728bb1 mail(1): Bring some fixes from other BSDs.
Fix missing forked job changes from r302776 in wait_child().

Obtained from:	NetBSD
2016-07-14 02:25:29 +00:00
Mark Johnston
0691d32ba4 Remove gcore's -s option.
It has no effect and is always implicitly set since ptrace(2) stops the
target process.
2016-07-14 00:32:27 +00:00
Pedro F. Giffuni
b22a869924 mail(1): Bring some fixes from other BSDs.
- Use varargs properly
- Use pid_t
- Better handling of error conditions on forked jobs.
- Some prototype and warning cleanups.

Obtained from:	NetBSD (some originaly from OpenBSD)
2016-07-13 16:45:26 +00:00
Pedro F. Giffuni
dde0f2bfd3 mail(1): check for out of memory conditions when calling calloc(3).
Suggested by:	oshogbo
MFC after:	3 days
2016-07-13 14:59:17 +00:00
Konstantin Belousov
de56aee0bf Trace timeval parameters to the getitimer(2) and setitimer(2) syscalls.
Reviewed by:	jhb
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D7158
2016-07-13 14:37:58 +00:00
Andrey A. Chernov
8e0303b03b Fully back out r302594 case 2) since overflow may happens. 2016-07-13 07:56:01 +00:00
Pedro F. Giffuni
3af7c80523 mkimg(1): minor cleanups with argument order in calloc(3).
Generally the first argument in calloc is supposed to stand for a count
and the second for a size. Try to make that consistent. While here,
attempt to make some use of the overflow detection capability in
calloc(3).
2016-07-12 15:46:53 +00:00
Andrey A. Chernov
75a1631e30 Undo r302599 and partially r302594 case 2):
since WCHAR_MAX can be not a valid wchar value, it is easier to stay
inside wint_t.
2016-07-12 04:29:34 +00:00
Andrey A. Chernov
1cdf6eaaaf Cast WCHAR_MAX to wint_t, it can be unsigned on some systems. 2016-07-11 23:06:11 +00:00
Andrey A. Chernov
1ef4039ac7 1) Following r302512 (remove collation support for [a-z]-ranges in libc)
remove collation support for a-z ranges here too.
It was implemented for single byte locales only in any case.

2) Reduce [Cc]flag loop to WCHAR_MAX, WINT_MAX here includes WEOF which is
not a character.

3) Optimize [Cc]flag case: don't repeatedly add the last character of
string2 to squeeze cset when string2 reach its EOS state.

4) Reflect in the manpage that [=equiv=] is implemented for single
byte locales only.
2016-07-11 21:23:50 +00:00
Pietro Cerutti
5a4d1cc66f Do not truncate lines longer than 512 chars.
PR:		210344
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D6881
2016-07-11 08:05:46 +00:00
Xin LI
56858424bb Use _PATH_DEVNULL instead of hardcoding.
MFC after:	2 weeks
2016-07-11 05:44:58 +00:00
Pedro F. Giffuni
24b797cc1a mail(1): Fix a comment.
Obtained from:	NetBSD (CVS Rev 1.29)
2016-07-11 00:03:39 +00:00
Pedro F. Giffuni
d6f7a4fb17 mail(1): Invert calloc(3) argument order.
calloc(3) is documented to have first a number and then a size.

Obtained from:	OpenBSD (through NetBSD)
2016-07-10 02:46:20 +00:00
Baptiste Daroussin
0833e924c6 Revert the change from errx/strerror to errc to appease gcc 4.2 2016-07-09 06:52:55 +00:00
Eitan Adler
9cb2b25464 Add -P to pathchk usage 2016-07-09 04:56:28 +00:00
Baptiste Daroussin
aa0bf3d606 Sync usage between program and man page. Increase column width. [1]
Simplifay the usage() function
Replace errx/strerror with errc

Submitted by:	wiz@NetBSD.org [1]
Obtained from:	NetBSD
2016-07-08 23:40:25 +00:00
Baptiste Daroussin
c60ba08a6b Add RCS Id. Sort options in SYNOPSIS. Fix macro usage. Fix Dd.
Submitted by:	wiz@NetBSD.org
Obtained from:	NetBSD
2016-07-08 23:10:55 +00:00
Ed Maste
932d4e19e6 lorder: produce locale-independent symbol ordering
Found by the Debian reproducible builds effort -- Debian bug 830259.

Reported by:	Reiner Herrmann <reiner@reiner-h.de>
Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
2016-07-07 20:50:59 +00:00
Enji Cooper
b943c77347 Fix .../usr.bin/lastcomm/legacy_test:main on i386
The time in the output files was ahead by 3 hours on i386. Fix the incorrect
offset.

Differential Revision: https://reviews.freebsd.org/D7079 (as part of a larger diff)
MFC after: 1 week
PR: 210329
Reported by: asomers
Approved by: re (gjb)
Reviewed by: cem
Sponsored by: EMC / Isilon Storage Division
2016-07-03 17:52:21 +00:00
Enji Cooper
a96a4734c0 Output the diffs to standard error when comparing the expected vs the
obtained output from lastcomm instead of just printing out a summary, e.g.
"they differed".

This will make failures with results more apparent when running kyua debug,
kyua report-html, etc.

Differential Revision: https://reviews.freebsd.org/D7079 (as part of a larger diff)
MFC after: 1 week
Approved by: re (gjb)
Reviewed by: cem
Sponsored by: EMC / Isilon Storage Division
2016-07-03 17:51:24 +00:00
Alan Somers
2101ef6b90 Skip lastcomm and sa tests on unsupported architectures
usr.bin/lastcom/tests/Makefile
usr.sbin/sa/tests/Makefile
	Set allow_architectures appropriately.  These tests depend on golden
	files that must be generated for each architecture, and haven't yet
	been generated for all of them.

PR:		210566
PR:		204154
Reviewed by:	ngie
Approved by:	re (gjb)
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D6960
2016-06-26 00:53:31 +00:00
Michael Tuexen
edc9c7fc7c This patch fixes two bugs:
* sctp46, tcp46, and udp46 sockets are displayed as such and not as
  sctp4 6, tcp4 6, udp4 6. This bug was introduced in
  http://svnweb.freebsd.org/base?view=revision&revision=187915
* For SCTP sockets, the the -4 and -6 flags are honoured as much as
  possible. This means IPv4 sockets are handled correctly,  IPv6
  sockets are displayed as sctp46, since it is currently not possible
  to distinguish between sctp6 and sctp46.

Approved by:	re (gjb)
MFC after:	1 week
2016-06-25 12:46:18 +00:00
Mark Johnston
0367ff567c gcore: Forward pending signals when detaching from the target.
Otherwise gcore's ptrace attach operation can race with delivery of a
signal and cause it to be lost.

In collaboration with:	Suraj Raju <sraju@isilon.com>
Reviewed by:	bdrewery
Approved by:	re (gjb, kib)
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-06-24 20:21:32 +00:00
Martin Matuska
f061a2215f MFV r302003,r302037,r302038,r302056:
Update libarchive to 3.2.1 (bugfix and security fix release)

List of vendor fixes:
- fix exploitable heap overflow vulnerability in Rar decompression
  (vendor issue 719, CVE-2016-4302, TALOS-2016-0154)
- fix exploitable stack based buffer overflow vulnebarility in mtree
  parse_device functionality (vendor PR 715, CVE-2016-4301, TALOS-2016-0153)
- fix exploitable heap overflow vulnerability in 7-zip read_SubStreamsInfo
  (vendor issue 718, CVE-2016-4300, TALOS-2016-152)
- fix integer overflow when computing location of volume descriptor
  (vendor issue 717)
- fix buffer overflow when reading a crafred rar archive (vendor issue 521)
- fix possible buffer overflow when reading ISO9660 archives on machines
  where sizeof(int) < sizeof(size_t) (vendor issue 711)
- tar and cpio should fail if an input file named on the command line is
  missing (vendor issue 708)
- fix incorrect writing of gnutar filenames that are exactly 512 bytes
  long (vendor issue 682)
- allow tests to be run from paths that are equal or longer than 128
  characters (vendor issue 657)
- add memory allocation errors in archive_entry_xattr.c (vendor PR 603)
- remove dead code in archive_entry_xattr_add_entry() (vendor PR 716)
- fix broken decryption of ZIP files (vendor issue 553)
- manpage style, typo and description fixes

Post-3.2.1 vendor fixes:
- fix typo in cpio version reporting (Vendor PR 725, 726)
- fix argument range of ctype functions in libarchive_fe/passphrase.c
- fix ctype use and avoid empty loop bodies in WARC reader

MFC after:	1 week
Security:	CVE-2016-4300, CVE-2016-4301, CVE-2016-4302
Approved by:	re (kib)
2016-06-22 07:49:59 +00:00
Ed Maste
023075def4 mkimg: bump version to 20151211 after r292082
mkimg has had a number of functional additions after the last time the
version was incremented. Do so now, to r292082's commit date, so that
users can determine what is supported.

Reviewed by:	marcel
Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D6882
2016-06-17 18:49:42 +00:00
Bryan Drewery
bc2abcfdef Add clang-format under WITH_CLANG_EXTRAS.
Reviewed by:	dim
Approved by:	re (gjb)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D6856
2016-06-17 16:46:58 +00:00
Ed Maste
11c4d924e1 ar: enable reproducible output by default when invoked as 'ar -s'
ar output is already deterministic by default for ar -q and ar -r, and
when invoked as ranlib. Make ar -s equivalent to ranlib and enable
deterministic output by default in that case too.

PR:		210330
Reviewed by:	bdrewery
Approved by:	re (gjb)
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D6871
2016-06-16 21:22:26 +00:00
Bryan Drewery
384850e063 WITH_META_MODE: Fix rebuilding maketab outside of build-tools.
The bsd.dep.mk yacc targets rely on only the .c file getting a .meta
file.  However the previous code here relying on only the .h file meant
that it would be generated with a .meta file.  r301285 made it so that
the .h file is never expected to get a .meta file.  To keep this
restriction in place add in an extra dependency on the .c file so that
it is generated at this time.  It's a hack but the best for the patterns
we have at the moment for handling build-tools and side-effect-generated
files.

Reported by:	Mark Millard
Approved by:	re (implicit)
Sponsored by:	EMC / Isilon Storage Division
2016-06-14 16:20:05 +00:00
Matthew Ahrens
09e6df8038 Add myself (mahrens) to calendar.freebsd
Approved by:	mckusick
Approved by:	re (gjb)
2016-06-13 23:36:15 +00:00
Enji Cooper
2c212dcc1e Change my given name from "Garrett" to "Ngie"
A legal name change from "Garrett" to "Ngie", as well as a FreeBSD
account name change, is pending.

Approved by: re (hrs)
2016-06-13 10:30:49 +00:00
Jilles Tjoelker
649a3a5626 install: When preserving timestamps, also copy the nanoseconds part.
Now that we have utimensat in -legacy, install(1) can use it.

This is a revert of r299942 which is itself a revert of r299850.
2016-06-09 21:59:35 +00:00
John Baldwin
d3a5e7a338 Add support for truss'ing Linux/x86_64 binaries under amd64.
Prodding by:	xmj
2016-06-09 02:21:07 +00:00
Simon J. Gerraty
39ac7ef49a Merge bmake-20160606
o dir.c: extend mtimes cache to others via cached_stat()
2016-06-08 17:51:21 +00:00
Don Lewis
290dadbd56 Fix a (false positive?) Argument cannot be negative coverity defect.
Rather than guarding close(fd) with an fd >= 0 test and setting fd
to -1 when it is closed to avoid a potential double-close, just
move the close() call after the conditional "goto make_token".  This
moves the close() call totally outside the loop to avoid the
possibility of calling it twice.  This should also prevent a Coverity
warning about checking fd for validity after it was previously passed
to read().

Reported by:	Coverity
CID:		1355335
MFC after:	1 week
X-MFC with:	r299484
2016-06-08 02:14:05 +00:00
Pedro F. Giffuni
b67565942b indent(1): Fix typo.
It's typedef, not typdef.

Obtained from:	OpenBSD (CVS rev. 1.20)
MFC after:	3 days
2016-06-06 16:10:52 +00:00
Bryan Drewery
1e325b6598 Use the in-tree sys/elf_common.h
This is the same fix as r301471.
2016-06-05 23:34:19 +00:00
Simon J. Gerraty
b778b302be Import bmake-20160604
Performace improvements for meta mode.
2016-06-05 20:26:16 +00:00
Edward Tomasz Napierala
4e5408f10c Report negotiated MaxBurstLength and FirstBurstLength in "iscsictl -v"
and "ctladm islist -v" outputs.

MFC after:	1 month
2016-06-05 08:48:37 +00:00
Mark Johnston
0f1c6d28f5 Document getent(1)'s ability to enumerate netgroup members.
MFC after:	3 days
2016-06-04 21:34:06 +00:00
Bryan Drewery
6e9a3c415e DIRDEPS_BUILD: Connect new directories and update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-06-03 19:25:30 +00:00
Michael Tuexen
55a87f85cf Fix two types which resulted in setting the address long wrong
for IPv6 addresses.

Reported by:	pfg@
CID:		1347086
MFC after:	1 week
2016-06-02 17:31:37 +00:00
Pedro F. Giffuni
7e77774311 sed(1): Fix a mismatch and sync with the OpenBSD's commit.
This was causing some strange behaviour.

Reported by:	olivier
Obtained from:	OpenBSD (CVS rev. 1.28)
2016-06-01 16:53:02 +00:00
Mark Johnston
cc7f01a5da mkimg: Indicate that input file pages are unlikely to be reused.
mkimg(1) uses a swap file to back input file chunks. When the output file
is being written out, blocks of the swap file are mapped and their contents
copied. This causes the backing VM pages to enter the active queue, and when
the output file is large relative to system memory (as is generally the
case), can result in a shortfall of inactive memory. This causes the
pagedaemon to aggressively scan the active queue and swap out process
memory in an attempt to meet the shortfall. Because mkimg's input files
are typically the intermediate result of some build process, there's no
need to push them all through the active queue. Use madvise(2) to indicate
that the backing pages may be reclaimed in preference to active pages. In
the case of the swap file, these pages will be freed as soon as mkimg
exits anyway.

When using mkimg on a desktop-class system with large amounts of dirty
process memory, this change substantially improves mkimg runtime and
reduces swap usage.

Reviewed by:	marcel
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D6654
2016-06-01 02:30:06 +00:00
Edward Tomasz Napierala
ba165a31b3 Add "iscsictl -e". Among other things, it makes it possible to perform
discovery without attaching to the targets ("iscsictl -Ad ... -e off"),
and then attach to selected ones ("iscsictl -Mi ... -e on").

PR:		204129
MFC after:	1 month
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D6633
2016-05-31 11:32:07 +00:00