Commit Graph

11817 Commits

Author SHA1 Message Date
Dimitry Andric
875ed54817 Update llvm/clang to r242221. 2015-08-12 18:31:11 +00:00
Dimitry Andric
1347814ced Merge ^/head r285924 through r286421. 2015-08-07 20:18:55 +00:00
Marcel Moolenaar
8f1d6b6915 Fix typo introduced in previous commit.
Pointed out by: Nikolai Lifanov <lifanov at mail.lifanov.com>
2015-08-07 18:40:44 +00:00
Marcel Moolenaar
de93252622 o Fix a typo.
o  Describe the file formats mkimg can create.
2015-08-07 17:22:37 +00:00
Marcelo Araujo
b47f904d8f Remove an extra new line on usage().
Rename domain to domainname to be identical to the man page.

Reported by:	bde
2015-08-07 07:05:47 +00:00
Marcel Moolenaar
9286ca0227 Rebase after r286395: rounding fix for dynamic VHD 2015-08-07 04:35:43 +00:00
Marcel Moolenaar
c20f01c4ea Fix the dynamic VHD format to work with qemu. The size of the disk
is taken to match the geometry and only when the geometry is max'd
out, is the actual recorded size taken.

Note that qemu has the same logic for the fixed VHD format. However
that is known to conflict with Microsoft Azure, where the recorded
size of the image is what counts.

Pointed out by: gjb@
2015-08-07 04:27:51 +00:00
Marcelo Araujo
e6330ffeee Get closest as possible with style(9). No functional change.
Differential Revision:	D3295
Reviewed by:		bapt
2015-08-07 02:37:47 +00:00
John Baldwin
1e2ec671fc Consistently use both leading and trailing spaces inside of the {}'s
when pretty-printing structures.  Most structures used both spaces,
but some only used a trailing space and some used neither.
2015-08-06 20:05:40 +00:00
John Baldwin
0a46af44bf Whitespace fixes to consistently use spaces before }'s and
wrap long lines.
2015-08-06 19:36:47 +00:00
John Baldwin
7d89732757 Decode the arguments passed to the *at() family of system calls. This is
especially useful now that libc's open() always calls openat().  While here,
fix a few other things:
- Decode the mode argument passed to access(), eaccess(), and faccessat().
- Decode the atfd paramete to pretty-print AT_FDCWD.
- Decode the special AT_* flags used with some of the *at() system calls.
- Decode arguments for fchmod(), lchmod(), fchown(), lchown(), eaccess(),
  and futimens().
- Decode both of the timeval structures passed to futimes() instead of just
  the first one.
2015-08-06 19:08:33 +00:00
John Baldwin
e82ce59c37 Decode the arguments to mkfifo() and fix an off-by-one error in the arguments
to mknod().
2015-08-06 18:32:32 +00:00
John Baldwin
19d637849e Don't mark the fcntl flag argument as an output parameter so that it is
always decoded.  Previously the argument was not decoded if fcntl() failed.
2015-08-06 18:28:15 +00:00
John Baldwin
d98d7ba0b4 Add recently added values of various flags and enumerations including
kevent filters, kevent flags, flags to mmap, seek locations, fcntl
operations, file flags, socket domains, open flags, resource limits, and
pathconf values.
2015-08-06 01:49:18 +00:00
Xin LI
3fd78bfab2 Fix shell injection vulnerability in patch(1) via ed(1) by
tightening sanity check of the input. [1]

While I'm there also replace ed(1) with red(1) because we do
not need the unrestricted functionality. [2]

Obtained from:	Bitrig [1], DragonFly [2]
Security:	CVE-2015-1418 [1]
2015-08-05 22:04:54 +00:00
Jilles Tjoelker
a2925a5ae3 find: Fix segfault with very long path in -exec/-ok ... {} \;.
If the resulting argument is longer than MAXPATHLEN, realloc() was called to
extend the space, but the new pointer was not correctly stored.

Different from what OpenBSD has done, rewrite brace_subst() to calculate the
necessary space first and realloc() at most once.

As before, the e_len fields are not updated in case of a realloc.
Therefore, a following long argument will do another realloc.

PR:		201750
MFC after:	1 week
2015-08-05 21:33:30 +00:00
John Baldwin
abb3f965d1 Rework get_string() to make it more robust when fetching strings of unknown
length.  In particular, instead of blinding fetching 1k blocks, do an initial
fetch up to the end of the current page followed by page-sized fetches up to
the maximum size.  Previously if the 1k buffer crossed a page boundary and
the second page was not valid, the entire operation would fail.
2015-08-05 18:14:01 +00:00
John Baldwin
7582c8ea08 Whitespace fix: remove some spurious spaces before commas. 2015-08-05 18:10:46 +00:00
Allan Jude
e896b4a4f0 xargs now takes -P0, creating as many concurrent processes as possible
PR:		199976
Submitted by:	Nikolai Lifanov <lifanov@mail.lifanov.com>
Reviewed by:	mjg, bjk
Approved by:	bapt (mentor)
MFC after:	1 month
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D2616
2015-08-04 14:27:25 +00:00
Marcelo Araujo
c52bab1135 Get it closes to style(9).
Staticization usage() and printit().
Fix the usage of err(3).

Reviewed by:	bde
2015-08-04 07:04:36 +00:00
Pedro F. Giffuni
a8126b4c70 Revert r286144 leaving the original fix to the buffer overflow.
Some developers consider the new code unnecessarily obfuscated.
There was also a benign off-by-one.

Discussed with:	bde, vangyzen, jmallett
2015-08-04 02:56:31 +00:00
Marcelo Araujo
c1f70e3747 Remove the 3rd clause of BSD LICENSE.
Sync the code with the OpenBSD version.
Small style(9) fix up.

Differential Revision:	D3212
Reviewed by:		rodrigc, bapt
Obtained from:		OpenBSD
Sponsored by:		gandi.net
2015-08-04 02:41:14 +00:00
Marcelo Araujo
eb2e6d158d Remove the 3rd clause of BSD LICENSE.
Sync the code with the OpenBSD version.

Differential Revision:	D3213
Reviewed by:		rodrigc, bapt
Obtained from:		OpenBSD
Sponsored by:		gandi.net
2015-08-04 02:34:51 +00:00
Baptiste Daroussin
5c23d0ee98 Remove never used file
Obtained from:	DragonFlyBSD
2015-08-03 18:47:45 +00:00
Marcel Moolenaar
ddaceed224 Make image_copyout_zeroes() an interface function. 2015-08-03 01:24:48 +00:00
Jason Unovitch
0697ab6ec0 - Add myself to the calendar.freebsd. (fix typo in r286160)
Approved by:	delphij (mentor)
Differential Revision:	https://reviews.FreeBSD.org/D3265
2015-08-01 17:48:35 +00:00
Jason Unovitch
994cfa1f63 - Add myself to the committers-ports.dot and add my mentor relationship.
- Add myself to the calendar.freebsd.

Approved by:	delphij (mentor)
Differential Revision:	https://reviews.FreeBSD.org/D3265
2015-08-01 17:29:52 +00:00
John-Mark Gurney
c47f6acf73 use : instead of true...
Change file file to file1 file2, partly for igor, and partly because
it's odd to pass the same file to a command twice..
2015-08-01 17:27:47 +00:00
Pedro F. Giffuni
fc9ce3812d Buffer overflow in wall(1).
Revert r286102 and apply a cleaner fix.
Tested for overflows by FORTIFY_SOURCE GSoC (with clang).

Suggested by:	bde
Reviewed by:	Oliver Pinter
Tested by:	Oliver Pinter
MFC after:	3 days
2015-08-01 01:29:55 +00:00
Ed Maste
ad6fe9fac7 Use standard 'THE AUTHOR' license text
Approved by:	jmg
2015-07-31 16:45:42 +00:00
Pedro F. Giffuni
479184e919 Buffer overflow in wall(1).
This affected syslogd, wall and talkd.
Detected by FORTIFY_SOURCE GSoC (with clang).

Submitted by:	Oliver Pinter
Differential Revision:	https://reviews.freebsd.org/D3254
Reviewed by:	delphij, jmg
MFC after:	3 days
2015-07-31 01:12:31 +00:00
Craig Rodrigues
4ed2d460bd Use correct number of arguments to semctl() for IPC_RMID.
PR:			118292
Submitted by:		araujo
Differential Revision:	D2669
2015-07-30 19:44:46 +00:00
Craig Rodrigues
bc81f73771 Get function prototypes for msg, shm, sem functions
from header files.

Differential Revision: D2669
2015-07-30 18:59:01 +00:00
Craig Rodrigues
2736982e9b Make some variables and functions static. 2015-07-30 18:08:08 +00:00
Ed Maste
5ea9e83e2f Allow ELF Tool Chain elfcopy to be installed as objcopy
ELF Tool Chain elfcopy is nearly a drop-in replacement for GNU objcopy,
but does not currently support PE output which is needed for building
x86 UEFI bits.

Add a src.conf knob to allow installing it as objcopy and set it by
default for aarch64 only, where we don't have a native binutils.

Reviewed by:	bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2887
2015-07-29 18:45:38 +00:00
Ed Maste
a80ac30b2d ar: Fix deterministic mode default with options other than -q or -r
Reported by:	jhibbits
Reviewed by:	jhibbits
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3237
2015-07-29 17:34:26 +00:00
Ed Maste
fc964cbf4e ar: enable deterministic mode by default
Ar cannot handle UIDs with more than 6 digits, and storing the mtime,
uid, gid and mode provides little to negative value anyhow for ar's
uses. Turn on deterministic (-D) mode by default; it can be disabled by
the user with -U.

PR:		196929
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3190
2015-07-29 13:36:17 +00:00
Marcelo Araujo
006a388bb6 Compilers will complain the usage of obsolescent variable declarations.
Also it will fix the build problem with sparc64.

Submitted by:	ed@
2015-07-29 02:21:35 +00:00
Xin LI
1e3e581593 Fix shell injection vulnerability in patch(1) and drop SCCS
support by replacing system() with execve().

Future revisions may remove the functionality completely.

Obtained from:	Bitrig
Security:	CVE-2015-1416
2015-07-28 19:58:36 +00:00
Marcelo Araujo
033af09de1 Staticfy and constify some variables and clean up the code a bit to make it
more readable. No functional change.

Differential Revision:	D3166
Reviewed by:		kib
Sponsored by:		gandi.net
2015-07-28 02:32:40 +00:00
Dimitry Andric
5f78ec1c9f Merge ^/head r285793 through r285923. 2015-07-27 22:20:28 +00:00
Xin LI
7d477dc35a Rewrite scan procedure with a FSM. This improves code readability by
making clear transits between different states, and avoids bug with
handling repeated $'s.

Reviewed by:	bapt
Differential Revision: https://reviews.freebsd.org/D3221
2015-07-27 19:21:23 +00:00
Baptiste Daroussin
c048a83f51 Replace GNU RCS ident with a BSD license ident
Rationale: ident(1) is useful out of RCS, lot of scripts are using ident(1) and
failing when base is built WITHOUT_RCS.

This version is:
- fully compatible with RCS 5.7 ident.
- fully compatible with RCS 5.9 ident.
- passes all ident test from GNU RCS 5.9 test suite

This version has support for: svn extension for the Keyword id (double colon and
# before last $)

Différences with GNU RCS ident:
- no long options as found in GNU RCS 5.9 (but not commented there).
- '-V' reports nothing but has been added for compatibility.

Differential Revision:	https://reviews.freebsd.org/D3200
Reviewed by:	pfg
2015-07-26 11:21:36 +00:00
Pedro F. Giffuni
3c0948a6b2 Bump GCC max-inline-insns-single in libiconv_modules and grep
This is required by our FORTIFY_SOURCE implementation as it
does more inlining. As a rule of thumb, FORTIFY_SOURCE doubles
the number  of inlines except that in grep inlining
blows up for some reason.
2015-07-26 00:11:04 +00:00
Ed Maste
7072861cd0 ar: add -U (unique) option to disable -D (deterministic) mode
This is required in order for us to support deterministic mode by
default.  If multiple -D or -U options are specified on the command
line, the final one takes precedence.  GNU ar also uses -U for this.

An equivalent change will be applied to ELF Tool Chain's version of ar.

PR:		196929
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3175
2015-07-24 17:46:43 +00:00
Ed Maste
6df1985625 truss: follow pdfork()ed descendents with -f
PR:		201276
Reported by:	David Drysdale
Reviewed by:	oshogbo
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2976
2015-07-24 16:57:13 +00:00
Ed Maste
119b75925c Add RISC-V ELF machine type definition
EM_RISCV is now officially registered as e_machine 243.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-07-24 16:52:21 +00:00
Baptiste Daroussin
24ef74209a inode should be different to actually mean mandocdb is in used
Sponsored by:	gandi.net
2015-07-24 09:20:02 +00:00
Baptiste Daroussin
772246ef18 Fix man -k with mandocdb
If apropos(1) and whatis(1) are not hardlinks to man(1) that means the system is
using mandocdb, then man -k should spawn apropos(1) and/or whatis(1) directly

Reported by:	kevlo
Tested by:	kevlo
Sponsored by:	gandi.net
2015-07-24 09:10:03 +00:00
Dimitry Andric
8d0f10857a Merge ^/head r285341 through r285792. 2015-07-22 19:55:32 +00:00