Commit Graph

12585 Commits

Author SHA1 Message Date
Ed Maste
f987297fc9 Add a WITHOUT_DIALOG src.conf(5) knob
It also turns off dependencies (bsdinstall, bsdconfig, dpv, tzsetup).

Reviewed by:	dteske
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7969
2016-09-27 18:08:38 +00:00
Ruslan Bukin
60e5fa86df Increase timeout for legacy_test from 300 (default) to 600 seconds.
It takes about 7 minutes to pass the test on MIPS64EB in QEMU.

Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-09-26 13:59:18 +00:00
Marcel Moolenaar
7b5a53ea4d Portability changes:
1.  macOS nor Linux have MAP_NOCORE nor MAP_NOSYNC. Define as 0.
2.  macOS doesn't have SEEK_DATA nor SEEK_HOLE. Define as -1
    so that lseek will return -1 (with errno set to EINVAL).
3.  gcc correctly warns that error is assigned but not used in
    image_copyout_region().  Fix by returning on the first error.
2016-09-26 04:14:00 +00:00
Marcel Moolenaar
5aad7d9a87 Avoid depending on the <sys/endian.h> header for le*enc and be*enc.
Not only is the header unportable, the encoding/decoding functions
are as well.  Instead, duplicate the handful of small inlines we
need into a private header called endian.h.

Aside: an alternative approach is to move the encoding/decoding
functions to a separate system header.  While the header is still
nonportable, such an approach would make it possible to re-use the
definitions by playing games with include paths. This may be the
preferred approach if more (build) utilities need this.  This
change does not preclude that.  In fact, it makes it easier.
2016-09-26 01:06:32 +00:00
Marcel Moolenaar
4039ea7c9b Eliminate the use of EDOOFUS. The error code was used to signal
programming errors, but is really a poor substitute for assert.
And less portable as well.
2016-09-26 00:41:08 +00:00
Marcel Moolenaar
5a1302ab2e Replace the use of linker sets with constructors for both the
formats and schemes.  Formats and schemes are registered at
runtime now, rather than collected at link time.
2016-09-25 22:57:59 +00:00
Marcel Moolenaar
ac3425511d Update local variable 'block' after calling capacity_resize(),
otherwise format_resize(), which is called right after, isn't
getting the current/actual image size. Rather than rounding up,
format_resize() could end up truncating the size and we don't
allow that by design.

MFC after:	1 week
2016-09-24 17:29:27 +00:00
Bryan Drewery
304336144c DIRDEPS_BUILD: Connect new directories.
Sponsored by:	Dell EMC Isilon
2016-09-23 22:46:19 +00:00
Konstantin Belousov
7402f93ef2 Provide proccontrol(1), an utility to control processes behaviour, related
to procctl(2).

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-09-23 12:34:54 +00:00
Joseph Mingrone
fef8f03390 Add myself (jrm) to calendar.freebsd
Approved by:    swills (mentor)
2016-09-21 18:52:49 +00:00
Alan Somers
005156d7b3 Update mkimg(1) author's contact info
Reviewed by:	marcel, imp
MFC after:	3 days
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D7991
2016-09-21 18:42:17 +00:00
Ed Maste
9e8f606352 elfdump: limit STDIN to no rights rather than closing it
Closing stdin/stdout/stderr is often a bad idea as a future open()
can end up with its fd. Leave it open and limit it to no rights
instead.

Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D7984
2016-09-20 21:38:12 +00:00
Ed Maste
23648b7d73 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.

Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D7954
2016-09-20 15:13:15 +00:00
Conrad Meyer
d36899d10f Move sys/capsicum.h includes after types.h or param.h
This is not actually documented or even implied in style(9).  Make the change
to match convention.  Someone should document this convention in style(9).

Reported by:	jhb
Sponsored by:	EMC Dell Isilon
2016-09-19 20:43:03 +00:00
Pedro F. Giffuni
0c9426b684 hexdump(1): Simplify by using asprintf(3)
Instead of strlen() + calloc() + snprintf, just use asprintf().
No functional change.

Obtained from:	OpenBSD (CVS Rev. 1.22)
2016-09-19 18:35:22 +00:00
Conrad Meyer
10cc720c25 indent(1): Capsicumify
This is a nice and trivial program for sandboxing.  One input file, one
output file.

Reviewed by:	pfg
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D7920
2016-09-19 16:16:14 +00:00
Conrad Meyer
875cba632b tr(1): Capsicumify
This is a straightforward single input, single output program for
capsicum.

Reviewed by:	bapt
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D7928
2016-09-19 16:14:38 +00:00
Conrad Meyer
e75a7302d3 cmp(1): Capsicumify
Reviewed by:	allanjude, bapt, oshogbo
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D7912
2016-09-19 16:13:00 +00:00
Baptiste Daroussin
3ba0c99044 Revert capsicum support
In some corner case VFS lookup is not working and I do not have time to debug
it for now.
2016-09-19 06:39:11 +00:00
Enji Cooper
720ca50063 Fix typo introduced in r305949 with the stable/10 bootstrapping logic
The header is sys/capability.h, not sys/capabilities.h

X-MFC with:	r305949
Pointyhat to:	bapt
Reported by:	allanjude, Jenkins
Sponsored by: 	Dell EMC Isilon
2016-09-19 03:02:43 +00:00
Ed Maste
06403dbce5 elfdump: adjust stdout/stderr capabilities
stdio uses fstat and the TIOCGETA ioctl. Also collapse the
cap_rights_limit and new cap_ioctls_limit calls into one if statement.
Errors here are not actionable by the user and distinguishing stdout
from stderr doesn't really have value.

Reported by:	kib
Reviewed by:	allanjude, bapt
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7944
2016-09-18 20:23:26 +00:00
Baptiste Daroussin
e645c6addb Simplify the fix for bootstrap tools
building head is not supported from prior to stable/10 where sys/capsicum.h was
named sys/capabilities.h

Reported by:	kib
2016-09-18 19:16:48 +00:00
Baptiste Daroussin
8197e93d39 Fix building as bootstrap tools on pre-capsicum.h systems 2016-09-18 18:49:18 +00:00
Baptiste Daroussin
160af93197 Better error checking
if getcwd fails: just ignore it and do not try to adding to the list of possible
path where to find the files.

if fdopen fails, warn and return NULL the rest of the code knows how to deal
with it

Reported by:	oshogbo
2016-09-18 18:03:06 +00:00
Baptiste Daroussin
b2c71bcefc style(9) fix
Reported by:	oshogbo
2016-09-18 17:56:14 +00:00
Baptiste Daroussin
d33dad44da Capsicum-ize tee(1)
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D7940
2016-09-18 16:34:40 +00:00
Baptiste Daroussin
224d9e3ed2 Capsicum-ize soelim(1).
As a trick to be able to access all files passed in arguments (readonly) within
the sandbox we first open the root directory, then consider all files as
relative to this file descriptor.

This might be improved once casper add supports for filesystem.

MFC after:	1 month
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D7936
2016-09-18 16:25:41 +00:00
Baptiste Daroussin
c59a0a34e8 Remove reference of z(s)diff which was dropped before importing 2016-09-18 10:06:35 +00:00
Warren Block
a63166d8fc Update history. Patch supplied by Sevan Janiyan <venture37@geeklan.co.uk>.
PR:		181390
Submitted by:	ksmakoto@dd.iij4u.or.jp
MFC after:	1 week
2016-09-16 14:23:16 +00:00
Ed Maste
6c6e388929 sdiff: improve errx string
errx() appends a newline so \n is superfluous. Also switch to lower case
with no period for consistency with other errx strings.
2016-09-15 02:48:56 +00:00
Ed Maste
6d9f0e4d70 bspatch: use #define for header size instead of magic number
Reviewed by:	allanjude, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7861
2016-09-15 01:58:12 +00:00
Ed Maste
b1ca2de9e9 login: clean up errx strings
errx() prefixes the error string with argv[0] so including "login: "
in the string is redundant. Also remove a superfluous newline.

Sponsored by:	The FreeBSD Foundation
2016-09-15 01:55:18 +00:00
Ed Maste
9b61efccf7 vtfontcvt: remove superfluous newlines in errx messages 2016-09-14 18:22:12 +00:00
Pedro F. Giffuni
be4391a2d5 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.

MFC after:	3 weeks
2016-09-14 16:47:17 +00:00
Ed Maste
04708d25e0 bspatch: remove superfluous newlines from errx strings 2016-09-12 14:28:38 +00:00
Simon J. Gerraty
95e3ed2cdb Update to bmake-20170818
This version has some new knobs for dealing with troublesome targets
in meta mode.
2016-09-09 01:09:39 +00:00
Gabor Kovesdan
a6be469014 - Fix typo
PR:		211245
Submitted by:	Christoph Schonweiler <public2016@hauptsignal.at>
MFC after:	5 days
2016-09-08 14:50:23 +00:00
Ed Maste
e3d9ae4c56 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.

Reviewed by:	allanjude, cem, kib
Obtained from:	anonymous gist
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7619
2016-09-06 19:00:37 +00:00
Dag-Erling Smørgrav
b6924c9309 Add a toggle to display the approximate amount of swap used by each
process.  We don't *quite* pull that number out of our backside, as
the actual number is difficult to determine without modifying the VM
system to report it, but it's still useful to get an idea of what's
going on when a machine unexpectedly starts swapping.

MFC after:	1 week
2016-09-05 08:27:04 +00:00
Hajimu UMEMOTO
2279a9a428 When -n is specified, don't make bogus DNS queries. Instead,
when -n is specified more than once, hostnames stored in utmp
are attempted to resolve to display them as network addresses.

PR:		212272
2016-09-02 18:28:14 +00:00
Marcelo Araujo
4c22fda976 - Invert calloc(3) argument order.
MFC after:	4 weeks
2016-09-01 15:23:33 +00:00
Ed Maste
d74808dd1a users: don't build when we don't have a C++ toolchain
(On RISC-V MK_CXX is in BROKEN_OPTIONS, so users remains skipped there.)

Reviewed by:	bdrewery
Differential Revision:	https://reviews.freebsd.org/D7725
2016-08-31 21:12:50 +00:00
Bryan Drewery
1eb4ec9c62 DIRDEPS_BUILD: Add some missing dirctories to the build.
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:59 +00:00
Bryan Drewery
776d5e11e9 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:46 +00:00
Dimitry Andric
c43262580d 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 after:	1 week
2016-08-30 19:02:15 +00:00
Bruce Evans
de618daaf0 Fix build without INET6 and with gcc. A function definition was ifdefed
for INET6, but its protototype was not, and gcc detects the error.
2016-08-27 11:06:06 +00:00
Xin LI
64093e14eb Use printable ASCII instead of octal representation.
MFC after:	2 weeks
2016-08-27 00:56:37 +00:00
Ed Maste
06ce2764a5 bspatch: remove output file in the case of error
Reviewed by:	oshogbo
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7644
2016-08-25 21:33:39 +00:00
Enji Cooper
8905590ba9 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".

MFC after:	1 week
Relnotes:	yes
Reviewed by:	wollman
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D7618
2016-08-25 17:07:43 +00:00
Allan Jude
76723b39ca 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.

Reviewed by:	emaste, ed, oshogbo, delphij
Approved by:	so
MFC after:	3 days
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D7358
2016-08-25 15:08:33 +00:00