12463 Commits

Author SHA1 Message Date
Eric van Gyzen
4f6fb7d621 MFC r308340
ncal: fix a reference to an out-of-scope stack buffer

PR:		214237
Submitted by:	Jonathan de Boyne Pollard
Sponsored by:	Dell EMC
2016-11-30 20:51:14 +00:00
Eric van Gyzen
127b62056a MFC r308824
locale: fix display of "grouping" and "mon_grouping" values

The "grouping" and "mon_grouping" values are arrays of one-byte
integers, not arrays of ASCII characters.  Display them in a format
similar to GNU and MacOS.

Sponsored by:	Dell EMC
2016-11-30 18:26:22 +00:00
Hajimu UMEMOTO
8651629f3a MFC r308808, r308809: Lookup locale when print all keywords as well. 2016-11-26 02:48:04 +00:00
Pedro F. Giffuni
ce128bed3a MFC r308314:
sed(1): add LEGACY_BSDSED_COMPAT compile-time flag.

In r297602, which included a __FreeBSD_version bump to 1100105, we changed
sed 'i' and 'a' from discarding whitespaces to conform with what GNU and
sysvish sed do.

There are arguments in favor of keeping the old behavior but the new
behavior is also useful for migration purposes. It seems important to at
least consider the case of developers depending on the previous behavior
so add a CFLAG to enable the old behavior.

PR:		213474
2016-11-09 18:00:50 +00:00
Baptiste Daroussin
a1683c1afb MFC: r302481
Revert the change from errx/strerror to errc to appease gcc 4.2

I have forgotten this part in r307794

Reported by:	lidl
2016-11-06 00:35:43 +00:00
Baptiste Daroussin
ec99d4d6d8 MFC r306782-r306783
r306782:
localedef: Fix ctype dump (fixed wide spread errors)

This commit is from John Marino in dragonfly with the following commit log:

====
This was a CTYPE encoding error involving consecutive points of the same
ctype.  It was reported by myself to Illumos over a year ago but I was
unsure if it was only happening on BSD.  Given the cause, the bug is also
present on Illumos.

Basically, if consecutive points were of the exact same ctype, they would
be defined as a range regardless.  For example, all of these would be
considered equivalent:

  <A> ... <C>, <H>  (converts to <A> .. <H>)
  <A>, <B>, <H>     (converts to <A> .. <H>)
  <A>, <J> ... <H>  (converts to <A> .. <H>)

So all the points that shouldn't have been defined got "bridged" by the
extreme points.

The effects were recently reported to FreeBSD on PR 213013.  There are
countless places were the ctype flags are misdefined, so this is a major
fix that has to be MFC'd.
====

This reveals a bad change I did on the testsuite: while 0x07FF is a valid
unicode it is not used yet (reserved for future use)

PR:		213013
Submitted by:	marino@
Reported by:	Kurtis Rader <krader@skepticism.us>
Obtained from:	Dragonfly
MFC after:	1 month

r306783:
localedef: Improve cc_list parsing

original commit log:
=====
I had originally suspected the parsing of ctype definition files as being
the source of the ctype flag mis-definitions, but it wasn't.  In the
process, I simplified the cc_list parsing so I'm committing the no-impact
improvement separately.  It removes some parsing redundancies and
won't parse partial range definitions anymore.
====

Submitted by:	marino
Obtained from:	Dragonfly
MFC after:	1 month
2016-11-05 09:46:48 +00:00
Glen Barber
5aab4f6fea MFC r308148, r308150, r308156:
r308148:
  Fix packaging calendar(1) files.

 r308150:
  Fix packaging /usr/share/examples/etc.

 r308156:
  Fix packaging /usr/lib{,32}/libgcc_eh{,_p}.a.

Sponsored by:	The FreeBSD Foundation
2016-11-03 00:34:37 +00:00
Martin Matuska
d2e2344ef4 MFC r307861:
Update libarchive to 3.2.2

Most of the post-3.2.1 fixes have already been merged. This update contains
just the version bump and some fixes to the test framework.
2016-10-31 21:57:18 +00:00
John Baldwin
15c20b8083 MFC 303002: Include process IDs in core dumps.
When threads were added to the kernel, the pr_pid member of the
NT_PRSTATUS note was repurposed to store LWP IDs instead of process
IDs.  However, the process ID was no longer recorded in core dumps.
This change adds a pr_pid field to prpsinfo (NT_PRSINFO).  Rather than
bumping the prpsinfo version number, note parsers can use the note's
payload size to determine if pr_pid is present.
2016-10-28 03:54:19 +00:00
Pietro Cerutti
0e55597de0 MFC r307638:
Chase a cornercase in printenv and sync its behaviour with builtin's

The cornercase is when printenv is passed a parameter in the form
VAR=val, where VAR=val exists in the environment. In this case, printenv would
print a spurious newline and returns 0.

Approved by:	cognet
MFC after:		1 week
2016-10-26 08:39:33 +00:00
Ed Maste
3a5f187fcb MFC r307520: elfdump: correct DT_AUXILIARY / DT_USED / DT_FILTER definitions
r109332 introduced these three as DT_SUNW_*. Update to the correct
names already used elsewhere in FreeBSD and the Sun "Linker and
Libraries Guide"
2016-10-24 00:39:04 +00:00
Baptiste Daroussin
09a41feb82 MFC r302471, r302473:
r302471:
Add RCS Id. Sort options in SYNOPSIS. Fix macro usage. Fix Dd.

Submitted by:	wiz@NetBSD.org
Obtained from:	NetBSD

r302473:
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-10-22 20:54:54 +00:00
Baptiste Daroussin
264eb90bef MFC r303265:
Remove reference cpp(1) which is not used anymore
2016-10-22 20:52:58 +00:00
Baptiste Daroussin
6899f28297 MFC r303783, r305927:
r303783:
sdiff: remove non finish/function code

2 extra options not available neither on other BSD nor in GNU sdiff:
--diff-pid and --pipe-fd were present in the SoC code, none were usable

Just remove it

r305927:
Remove reference of z(s)diff which was dropped before importing
2016-10-22 20:46:57 +00:00
Baptiste Daroussin
49c4c7e411 MFC: 305937
Capsicum-ize tee(1)

Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D7940
2016-10-22 13:20:02 +00:00
Baptiste Daroussin
d0a8ee09f4 MFC: 307368,307369,307372,307381
Remove the common.h include which is actually not used in sdiff.c
Turn editit into a static function
Move cleanup() into the edit.c file which is the only users of that function
Remove common.{c,h}
Fix typos in sdiff(1) message and improve display
2016-10-22 13:15:19 +00:00
Dag-Erling Smørgrav
dfa87bc644 MFH (r305414): add a toggle to show approximate swap usage. 2016-10-22 00:35:40 +00:00
Enji Cooper
00b5ceccb3 MFC r303367:
Testcase 7.8 no longer needs to be marked TODO

It passes out of the box today
2016-10-21 08:40:24 +00:00
Marcelo Araujo
299ca967da MFC r303541, r303542, r303543, r303545, r303546, r303547, r304225, r304226, r304605, r304676, r305212, r305863:
r303541:
Use nitems() from sys/param.h.

Sponsored by:	gandi.net (BSD Day Taiwan)
MFC after: 	2 weeks.

r303542:
Use nitems() from sys/param.h.

MFC after:	2 weeks.
Sponsored by:	gandi.net (BSD Day Taiwan)

r303543:
Use nitems() from sys/param.h.

MFC after:	2 weeks.
Sponsored by:	gandi.net (BSD Day Taiwan)

r303545:
Use nitems() from sys/param.h.

MFC after:	2 weeks.
Sponsored by:	gandi.net (BSD Day Taiwan)

r303546:
Use nitems() from sys/param.h.

MFC after:	2 weeks.
Sponsored by:	gandi.net (BSD Day Taiwan)

r303547:
Use nitems() from sys/param.h.

MFC after:	2 weeks.
Sponsored by:	gandi.net (BSD Day Taiwan)

r304225:
Use nitems() from sys/param.h.

MFC after:	2 weeks.

r304226:
Use nitems() from sys/param.h.

MFC after:	2 weeks.

r304605:
Fix calloc(3) argument order.

Reviewed by:	trasz
MFC after:	4 weeks.
Differential Revision:	https://reviews.freebsd.org/D7532

r304676:
Fix calloc(3) argument order.

MFC after:	4 weeks.

r305212:
- Invert calloc(3) argument order.

MFC after:	4 weeks

r305863:
Invert calloc(3) argument order.

Reviewed by:	ed.
MFC after:	4 weeks.
Differential Revision:	https://reviews.freebsd.org/D7902
2016-10-21 03:10:05 +00:00
Pietro Cerutti
34e8e06e7f MFC r302558:
Do not truncate lines longer than 512 chars.

PR:		210344
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D6881
2016-10-19 08:23:54 +00:00
Ed Schouten
20525c0f38 MFC r303818, r303833, r303941, r304478, r304481, r304483, r304484, r304554,
r304555, r304556, r304557, r304558, r304559, r304561, r304563, r304564,
    r304565, r304615, r304742, r304743, r304744, r304745, r304748, r304886,
    r304991, r305928, r305938, r305987, r306185:

  Bring CloudABI support back in sync with HEAD.

  - Add support for running 32-bit executables on amd64, armv6 and i386.

  - As these new architectures require the use of the vDSO, merge back
    vDSO support for 64-bit executables running on amd64 and arm64 as
    well. This has the advantage that support for vDSO-less execution
    can be phased out when 11.0 becomes unsupported, as opposed to 11.x.

  This change has been tested by running the cloudlibc unit tests on all
  supported architectures, which seems to work fine.
2016-10-12 12:17:41 +00:00
Pedro F. Giffuni
a5e5007ae5 MFC r306560, r306561:
patch(1): make some macros look boolean.

Minor cleanup inspired by a new patch(1) variant in schily tools.

For reference:
https://sourceforge.net/p/schillix-on/
2016-10-09 20:12:58 +00:00
Pedro F. Giffuni
1070f8aa3f MFC r305813:
localedef(1): make better use of calloc(3) arguments.

The first argument of calloc(3) should be an ordinal type, and the
second a size: split a multiplication to make better use of calloc(3)
and detect overflows.

Do some other re-ordering and style fixes while here.
2016-10-09 20:07:01 +00:00
John Baldwin
d9b00664b9 MFC 302859: 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.
2016-10-06 21:17:18 +00:00
Rick Macklem
23fcca0917 MFC: r304059
Update the man page to descibe the "-d" option added by r304058.

This is a content change.
2016-10-03 12:13:40 +00:00
Rick Macklem
973ee19995 MFC: r304058, r304066, r304194
Update nfsstat.c to use the new kernel nfsstat structure and
add the new "-d" flag from D1626.
The man page will be updated in a subsequent commit.
2016-10-03 12:02:45 +00:00
Konstantin Belousov
eeabbe51d7 MFC r306261:
Add proccontrol(1).

MFC r306281 (by bdrewery):
DIRDEPS_BUILD: Connect new directories.
2016-09-30 09:20:44 +00:00
Alan Somers
6bb2d686d3 MFC r306131
Update mkimg(1) author's contact info
2016-09-26 14:48:48 +00:00
Ed Maste
ef4b7f1de7 MFC bspatch Capsicumization, sanity checks, and other improvements
r304691: bspatch: apply style(9)

Make style changes (and trivial refactoring of open calls) now in order
to reduce noise in diffs for future capsicum changes.

r304807 (allanjude): Capsicumize bspatch

Move all of the fopen() and open() calls to the top of main()

Restrict each FD to least privilege (read/seek only, write only, etc)

cap_enter(), and make all except the output FD read/seek only.

r304821: bspatch: remove output file in the case of error

r305486: bspatch: add sanity checks on sizes to avoid integer overflow

Note that this introduces an explicit 2GB limit, but this was already
implicit in variable and function argument types.

This is based on the "non-cryptanalytic attacks against freebsd
update components" anonymous gist. Further refinement is planned.

r305737: bspatch: remove superfluous newlines from errx strings

r305822: bspatch: use #define for header size instead of magic number

r306026: bspatch: Remove backwards-compatibility sys/capability.h support

bspatch previously included sys/capability.h or sys/capsicum.h based
on __FreeBSD_version, as FreeBSD is the upstream for bsdiff and we may
see this file incorporated into other third-party software.

The Capsicum header is now installed as sys/capsicum.h in stable/10 and
FreeBSD 10.3, so we can just use sys/capsicum.h and simplify the logic.
2016-09-22 21:05:21 +00:00
Dimitry Andric
ef490d1746 MFC r305077:
Squelch clang 3.9.0 warnings about BASE (which is 32768) being converted
to -32768 when it is used as an argument to mp_itom(), in both libtelnet
and newkey.  This code has been wrong since r26238 (!), so after almost
20 years it is rather useless to try to correct it.

MFC r305086:

Fix warnings in telnet about invalid constant conversions, e.g.:

contrib/telnet/telnet/commands.c:2914:13: error: implicit conversion
from 'int' to 'char' changes value from 137 to -119
[-Werror,-Wconstant-conversion]
		*lsrp++ = IPOPT_SSRR;
			~ ^~~~~~~~~~
/usr/include/netinet/ip.h:152:21: note: expanded from macro 'IPOPT_SSRR'
#define IPOPT_SSRR              137             /* strict source route */
				^~~
contrib/telnet/telnet/commands.c:2916:13: error: implicit conversion
from 'int' to 'char' changes value from 131 to -125
[-Werror,-Wconstant-conversion]
		*lsrp++ = IPOPT_LSRR;
			~ ^~~~~~~~~~
/usr/include/netinet/ip.h:148:21: note: expanded from macro 'IPOPT_LSRR'
#define IPOPT_LSRR              131             /* loose source route */
				^~~

Use unsigned char buffers instead.
2016-09-07 18:22:08 +00:00
Enji Cooper
5b3e48463a MFC r304809:
Add non-TRUSTEDBSD prefixed knobs for the _PC_ACL* and {CAP,INF,MAC}_PRESENT knobs

It's not necessarily intuitive that the variables to query contain TRUSTEDBSD
in the prefix. Add non-TRUSTEDBSD prefixed knobs for querying things like
"_PC_ACL_NFS4".

Relnotes:	yes
2016-09-01 19:00:30 +00:00
Enji Cooper
b92423f29d MFC r303804:
Fix building usr.bin/tar/tests with PIE symbol building enabled by
removing CFLAGS+= -static

`CFLAGS+= -static` was a carryover from pre-r289195 with
usr.bin/tar/test/Makefile that should have been specified in LDFLAGS
There doesn't seem to be an apparent need for static compilation
of the test binaries.

Obtained-from:	opBSD (418a491eed20d2603ddd1f1bd92c2c0d95094002)
2016-08-28 07:19:33 +00:00
Enji Cooper
8568a8a53e MFC r303830,r304693,r304694,r304698:
r303830:

Remove vestigal references to __alpha__

Replace alpha reference in getconf(1) with amd64 [*]

PR:	 	211300 [*]

r304693:

Clean up trailing whitespace

r304694:

Add `MIN_HOLE_SIZE` pathconf(2) support to getconf

This allows shell programs to programmatically determine whether
or not a filesystem supports sparse files

r304698:

Add support for _PC_ACL_NFS4 as TRUSTEDBSD_ACL_NFS4

The TRUSTEDBSD prefix was chosen for consistency with the other
related `_PC_ACL*` prefixed variables.
2016-08-28 07:16:11 +00:00
Michael Tuexen
b3c2b068f8 MFC r304292:
Use names for SCTP and UDPLite when reporting the input histogram.

MFC r304295:
Fix the output for scope statistics.
2016-08-20 07:44:41 +00:00
Bryan Drewery
4779fb3427 MFC r303929,r303930,r303931,r303932,r303933:
r303929:
    Fix -S with -b not atomically updating the destination file.
  r303930:
    Support -v for -l.
  r303931:
    Fix -S with -l not being atomic.
  r303932:
    Fix -b failure not restoring flags on the destination file.
  r303933:
    Squelch a false-positive Clang static analyzer warning.
2016-08-19 16:56:52 +00:00
Konstantin Belousov
d98d4fc818 MFC r303990:
Remove unused prototypes.
2016-08-19 07:48:32 +00:00
Andrey A. Chernov
36bcb9a03a MFC r304374
Fix TAB replaced with spaces in prev. commit.
2016-08-18 10:37:20 +00:00
Andrey A. Chernov
e3f9d0cac6 MFC r303581
Fix date
2016-08-18 08:52:55 +00:00
Andrey A. Chernov
74b3eb419e MFC r303568
Remove another vestige of scripted conversion
2016-08-18 08:47:06 +00:00
Andrey A. Chernov
320b6ee80b MFC r303569
Reflect CLDR timedef changes
2016-08-18 08:36:24 +00:00
Andrey A. Chernov
8e012bd87f MFC r302827
Optimize [Cc]flag case: don't repeatedly add the last character of
string2 to squeeze cset when string2 reach its EOS state.
2016-08-17 09:12:02 +00:00
Andrey A. Chernov
e8f48b4ade MFC r302826
Document incomplete support of [=equiv=] and collation for ranges.
2016-08-17 09:10:22 +00:00
Andrey A. Chernov
f78d11b9a4 MFC r303094
Continuation lines with comments badly affects gprof, it is excluded from
build on amd64 f.e.
2016-08-17 08:37:40 +00:00
Enji Cooper
4f4d6ae102 MFC r303830:
Remove vestigal references to __alpha__

Replace alpha reference in getconf(1) with amd64 [*]

PR:	 	211300 [*]
2016-08-16 08:16:54 +00:00
Bryan Drewery
884883e23b MFC r303934,r303937,r303942:
r303934:
    Support rmdir(2).
  r303937:
    Use proper argument length for rmdir(2) for r303934.
  r303942:
    Fix sorting in r303934.
2016-08-15 09:36:43 +00:00
Baptiste Daroussin
17a146370f MFC: r303685
truss: fix uninitialized trussinfo->curthread in add_threads()/enter_syscall

trussinfo->curthread must be initialized before calling enter_syscall(),
it is used by t->proc->abi->fetch_args().
Without that truss is segfaulting and the attached program also crash.

Submitted by:		Nikita Kozlov (nikita@gandi.net)
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D7399
2016-08-14 22:43:48 +00:00
Kurt Lidl
321b4967d9 MFC r303515:
Make resizewin.1 manpage use .Fx macro

  Fix capitalization of "PuTTY" also.
2016-08-12 23:25:22 +00:00
Dimitry Andric
b6d66342c8 MFC r303676:
Fix a segfault in bsdgrep when parsing the invalid extended regexps "?"
or "+" (these are invalid, because there is no preceding operand).

When bsdgrep attempts to emulate GNU grep in discarding and ignoring the
invalid ? or + operators, some later logic in tre_compile_fast() goes
beyond the end of the buffer, leading to a crash.

Fix this by bailing out, and reporting a bad pattern instead.

Approved by:	re (gjb, kib)
Reported by:	Steve Kargl
2016-08-09 19:20:53 +00:00
Gleb Smirnoff
f4f76fbb39 Merge r303264 and corrections:
The date format for ru_RU.UTF-8 locale has changed some time ago, adjust
  the ru_RU.UTF-8 calendar files.

Approved by:	re (kib)
2016-08-02 14:14:36 +00:00
Eric van Gyzen
2a36bd13a9 MFC r303520
Fix markup for -j in cpuset(1) synopsis

Approved by:	re (kib)
Sponsored by:	Dell Inc.
2016-08-01 16:39:40 +00:00