openbsd
6 years agoremove unused files
eric [Wed, 3 Oct 2018 11:47:17 +0000 (11:47 +0000)]
remove unused files

6 years agocorrectly handle "+a:..." entries
eric [Wed, 3 Oct 2018 11:43:57 +0000 (11:43 +0000)]
correctly handle "+a:..." entries

from gilles@

ok otto@ gilles@

6 years agoadd filter option based on origin validation state
denis [Wed, 3 Oct 2018 11:36:39 +0000 (11:36 +0000)]
add filter option based on origin validation state

OK claudio@

6 years agoUpdate manual to reflect ROA changes
denis [Wed, 3 Oct 2018 06:57:36 +0000 (06:57 +0000)]
Update manual to reflect ROA changes

With input from claudio@, sthen@ and jmc@

OK claudio@ sthen@

6 years agoAllow ssh_config IdentityAgent directive to accept environment variable
djm [Wed, 3 Oct 2018 06:38:35 +0000 (06:38 +0000)]
Allow ssh_config IdentityAgent directive to accept environment variable
names as well as explicit paths. ok dtucker@

6 years agoFix a race condition that affects pfsync interface deletion.
visa [Wed, 3 Oct 2018 01:24:14 +0000 (01:24 +0000)]
Fix a race condition that affects pfsync interface deletion.

When a pfsync interface is being deleted, all its timeout handlers and
pfsync_send_dispatch() have to stop accessing the software context
before the context is freed. Ensure sufficient synchronization by
acquiring NET_LOCK() and clearing `pfsyncif' inside the critical
section in pfsync_clone_destroy(). When a timeout handler has entered
the critical section, it has to check `pfsyncif' and bail out if the
value is NULL. pfsync_send_dispatch() already does this check.

Issue reported and fix tested by Hrvoje Popovski.

OK mpi@ bluhm@

6 years ago- pfsync: avoid a recursion on PF_LOCK
sashan [Tue, 2 Oct 2018 23:44:39 +0000 (23:44 +0000)]
- pfsync: avoid a recursion on PF_LOCK

OK bluhm@

6 years agosync
jsg [Tue, 2 Oct 2018 22:35:20 +0000 (22:35 +0000)]
sync

6 years agoUnify the MD byteswapping code as much as possible across architectures.
naddy [Tue, 2 Oct 2018 21:30:44 +0000 (21:30 +0000)]
Unify the MD byteswapping code as much as possible across architectures.
Use inline functions instead of GNU C statement expressions, and
make them available to userland.  With clues from guenther@.

ok guenther@ kettenis@

6 years agoMake some USB ioctls return ENXIO, instead of EIO, if usbd_is_dying().
stsp [Tue, 2 Oct 2018 19:49:10 +0000 (19:49 +0000)]
Make some USB ioctls return ENXIO, instead of EIO, if usbd_is_dying().
Brings us one step closer towards making this condition's error code
consistent across all USB drivers.
Patch by Moritz Buhl
ok mpi@ bluhm@

6 years agoadd DESCRIPTION and .Ss to the toc; suggested by espie@
schwarze [Tue, 2 Oct 2018 19:43:27 +0000 (19:43 +0000)]
add DESCRIPTION and .Ss to the toc; suggested by espie@

6 years agoenable the equivalent of -O toc in man.cgi(8)
schwarze [Tue, 2 Oct 2018 19:40:05 +0000 (19:40 +0000)]
enable the equivalent of -O toc in man.cgi(8)

6 years agoFix potential rounding errors when calculating the qcow2 l1 and ref tables sizes
reyk [Tue, 2 Oct 2018 16:42:38 +0000 (16:42 +0000)]
Fix potential rounding errors when calculating the qcow2 l1 and ref tables sizes

OK ccardenas@ mlarkin@

6 years agoAdd an option -T html -O toc to add a brief table of contents near
schwarze [Tue, 2 Oct 2018 14:56:36 +0000 (14:56 +0000)]
Add an option -T html -O toc to add a brief table of contents near
the top of HTML pages containing at least two non-standard sections.
Suggested by Adam Kalisz and discussed with kristaps@ during EuroBSDCon 2018.

6 years agomention INFO@openssh.com for sending SIGINFO
djm [Tue, 2 Oct 2018 12:51:58 +0000 (12:51 +0000)]
mention INFO@openssh.com for sending SIGINFO

6 years agoAdd server support for signalling sessions via the SSH channel/
djm [Tue, 2 Oct 2018 12:40:07 +0000 (12:40 +0000)]
Add server support for signalling sessions via the SSH channel/
session protocol. Signalling is only supported to sesssions that
are not subsystems and were not started with a forced command.

Long requested in bz#1424

Based on a patch from markus@ and reworked by dtucker@;
ok markus@ dtucker@

6 years agoSupport a second argument to -O man,
schwarze [Tue, 2 Oct 2018 12:32:55 +0000 (12:32 +0000)]
Support a second argument to -O man,
selecting the format according to local existence of the file.
Suggested by kristaps@ during EuroBSDCon 2018.
Written on the train Frankfurt-Karlsruhe returning from EuroBSDCon.

6 years agoRender the eqn(7) "sqrt" function as U+221A in UTF-8 output.
schwarze [Tue, 2 Oct 2018 12:14:44 +0000 (12:14 +0000)]
Render the eqn(7) "sqrt" function as U+221A in UTF-8 output.
This also agrees with what groff does.
Suggested by an attendee of EuroBSDCon 2018 in Bucuresti.
Written on the plane Bucuresti-Frankfurt returning from EuroBSDCon.

6 years agodocument that uuid_create generates v4 uuids; from william orr
jmc [Tue, 2 Oct 2018 10:55:39 +0000 (10:55 +0000)]
document that uuid_create generates v4 uuids; from william orr
verified/ok tb

6 years agoAdd support for RT3290 chipset by James Hastings.
kevlo [Tue, 2 Oct 2018 02:05:34 +0000 (02:05 +0000)]
Add support for RT3290 chipset by James Hastings.

Tested by me and James Hastings.

6 years agoExpose BGP Origin Validation state in bgpctl show commands
job [Mon, 1 Oct 2018 23:09:53 +0000 (23:09 +0000)]
Expose BGP Origin Validation state in bgpctl show commands

OK denis@ claudio@

6 years agofix obvious pasto in the HISTORY section
schwarze [Mon, 1 Oct 2018 22:58:43 +0000 (22:58 +0000)]
fix obvious pasto in the HISTORY section

6 years agoAdd retguard to arm64 ld.so.
mortimer [Mon, 1 Oct 2018 22:53:48 +0000 (22:53 +0000)]
Add retguard to arm64 ld.so.
ok kettenis@

6 years agoAdd retguard to arm64 libc syscalls and setjmp / longjmp.
mortimer [Mon, 1 Oct 2018 22:49:50 +0000 (22:49 +0000)]
Add retguard to arm64 libc syscalls and setjmp / longjmp.
ok kettenis@

6 years agomention RTL8723AE
jmatthew [Mon, 1 Oct 2018 22:37:18 +0000 (22:37 +0000)]
mention RTL8723AE

6 years agoadd RTL8723AE support
jmatthew [Mon, 1 Oct 2018 22:36:08 +0000 (22:36 +0000)]
add RTL8723AE support

ok kevlo@ stsp@

6 years agorun the integrationtests/
benno [Mon, 1 Oct 2018 22:23:36 +0000 (22:23 +0000)]
run the integrationtests/

6 years agoadd new testcase for network statements (announcing/redistributing routes
benno [Mon, 1 Oct 2018 20:58:59 +0000 (20:58 +0000)]
add new testcase for network statements (announcing/redistributing routes
into bgpd).

6 years agoAllow DIOCRGETADDRS when securelevel(7) > 1
kn [Mon, 1 Oct 2018 19:47:30 +0000 (19:47 +0000)]
Allow DIOCRGETADDRS when securelevel(7) > 1

This fixes certain operations such as `pfctl -t foo -T show' when the
system is in "Highly secure mode". `pfctl -t foo -T show -v' would already
work due to a different ioctl (DIOCRGETASTATS) being used.

Reported by Zbyszek Żółkiewski, thanks!

OK sthen sashan

6 years agoOnly send 408 Timeout responses when we have seen at least part of a
benno [Mon, 1 Oct 2018 19:24:09 +0000 (19:24 +0000)]
Only send 408 Timeout responses when we have seen at least part of a
request.  Without a request, just close the connection when we hit
request timeout.
Prompted by a bug report from Nikola Kolev, thanks.
ok reyk@ and some suggestions from claudio@ and bluhm@

6 years agoUse inline functions instead of GNU C statement expressions for the MD
naddy [Mon, 1 Oct 2018 17:42:16 +0000 (17:42 +0000)]
Use inline functions instead of GNU C statement expressions for the MD
byteswapping code.
ok guenther@ kettenis@

This fixes a corner case triggered by the comms/hylafax port where
htons() can't be compiled in C++ code:
"Don't know how to handle indirect register inputs yet for constraint 'r'"

6 years agoFix potential double-free in error path
reyk [Mon, 1 Oct 2018 17:34:56 +0000 (17:34 +0000)]
Fix potential double-free in error path

qc2_open() calls qc2_close() on error which already frees diskp.

OK ccardenas@

6 years agoPut bridge_input & output back under the KERNEL_LOCK().
mpi [Mon, 1 Oct 2018 12:38:32 +0000 (12:38 +0000)]
Put bridge_input & output back under the KERNEL_LOCK().

Wireless drivers call if_enqueue() out of the NET_LOCK() so it cannot
be used to serialize bridge(4) states.

Found by stsp@, ok visa@

6 years agoregen
jmatthew [Mon, 1 Oct 2018 11:06:14 +0000 (11:06 +0000)]
regen

6 years agoadd RTL8723AE
jmatthew [Mon, 1 Oct 2018 11:05:08 +0000 (11:05 +0000)]
add RTL8723AE

6 years agoThe sequence number field in the 802.11 frame header includes the sequence
jmatthew [Mon, 1 Oct 2018 11:03:46 +0000 (11:03 +0000)]
The sequence number field in the 802.11 frame header includes the sequence
number and the fragment number, so shift it to get just the sequence number
for the tx descriptor.  While here, add a #define for the flag in the same
field that enables hardware sequence numbering, and use existing constants
for some R92C_RSV_CTRL writes.

prompted by feedback from kevlo@ on another diff, tested on 8188CE, EE, EU
ok stsp@ kevlo@

6 years agoTry to derive the qcow2 file format from an image file automatically.
reyk [Mon, 1 Oct 2018 09:31:15 +0000 (09:31 +0000)]
Try to derive the qcow2 file format from an image file automatically.

This makes the "-d qcow2:" and "format qcow" arguments optional as vmctl
and vmd will read the magic bytes at the beginning of a file to guess if
it is a raw or a qcow image file.

The "vmctl create" command has been changed by removing the -f qcow2 option
and replacing it with the same syntax as -d: "vmctl create qcow2:foo.img".
In a slightly ununixy but intended way, the create command now also
considers the file extension for the format as "vmctl create foo.qcow2"
creates a qcow2 disk and not a raw image file.

Ok mlarkin@ (and ccardenas@ on an earlier version of the diff)

6 years agoAdd missing URI encoding when writing HTTP redirects,
schwarze [Mon, 1 Oct 2018 08:05:25 +0000 (08:05 +0000)]
Add missing URI encoding when writing HTTP redirects,
fixing a bug reported by <jungleboogie0 at gmail dot com> on bugs@.
While here, fully validate the arch name
such that we do not have to URI encode that one.

6 years agoAs per POSIX, when str{,r}chr is comparing it should convert c to a char.
martijn [Mon, 1 Oct 2018 06:37:37 +0000 (06:37 +0000)]
As per POSIX, when str{,r}chr is comparing it should convert c to a char.

The C implementation of str{,r}chr are not linked to the build, because
assembly implementations are used, but change to code for easier reference.
At least the i386 and amd64 are checked and seem to do the correct thing.

Found thanks to the csh any/strchr change.

minor pointers and OK millert@

6 years agoupdate currency exchange rates;
jmc [Mon, 1 Oct 2018 06:06:59 +0000 (06:06 +0000)]
update currency exchange rates;

6 years agoAdd size limitation of group-name and a reference to ifconfig about it
solene [Sun, 30 Sep 2018 19:13:55 +0000 (19:13 +0000)]
Add size limitation of group-name and a reference to ifconfig about it

ok mlarkin@ jmc@ jca@

6 years agoadd spin lock in KERN_CPTIME cpu states
solene [Sun, 30 Sep 2018 18:58:17 +0000 (18:58 +0000)]
add spin lock in KERN_CPTIME cpu states

ok mpi@ jca@

6 years agoDelete the reserve_dumppages() declaration, missed in its 2010 removal
guenther [Sun, 30 Sep 2018 18:46:09 +0000 (18:46 +0000)]
Delete the reserve_dumppages() declaration, missed in its 2010 removal

ok deraadt@

6 years agodeny non-contiguous netmask
denis [Sun, 30 Sep 2018 18:19:24 +0000 (18:19 +0000)]
deny non-contiguous netmask

OK job@

6 years agotelnet argv parsing overflow; from YangX92
deraadt [Sun, 30 Sep 2018 14:35:32 +0000 (14:35 +0000)]
telnet argv parsing overflow; from YangX92
ok millert

6 years agoRemove the hopefully last remnants of kerberos in there: arg_login,
ajacoutot [Sun, 30 Sep 2018 13:29:24 +0000 (13:29 +0000)]
Remove the hopefully last remnants of kerberos in there: arg_login,
arg_notickets and invokinguser.

ok kn@ millert@

6 years agoMake the HISTORY sections of the "intro" manuals less confusing and
schwarze [Sun, 30 Sep 2018 13:24:32 +0000 (13:24 +0000)]
Make the HISTORY sections of the "intro" manuals less confusing and
more uniform; potential for confusion noticed by aalm@; OK jmc@.

6 years agoFor -w output in -m mode, tweak the handling of bytes that do not
schwarze [Sun, 30 Sep 2018 12:44:22 +0000 (12:44 +0000)]
For -w output in -m mode, tweak the handling of bytes that do not
form valid UTF-8: treat them as "not a whitespace character" and
hence "not a word boundary" in the same way as non-printable
characters and NUL bytes.

OK millert@

6 years agofix the rest of the bug mitigated in the previous commit:
schwarze [Sun, 30 Sep 2018 12:35:40 +0000 (12:35 +0000)]
fix the rest of the bug mitigated in the previous commit:
do not embark on an infinite loop
when -m is given and the file contains a NUL character;
OK millert@

6 years agovstate might be used uninitialized
denis [Sun, 30 Sep 2018 10:56:47 +0000 (10:56 +0000)]
vstate might be used uninitialized

OK claudio@

6 years agoin ECDH, gather statistics where it makes more sense
tb [Sun, 30 Sep 2018 10:56:46 +0000 (10:56 +0000)]
in ECDH, gather statistics where it makes more sense

6 years agouse a more common wording the authors section
anton [Sun, 30 Sep 2018 09:14:43 +0000 (09:14 +0000)]
use a more common wording the authors section

6 years agoAdd regression test for cmsg size bug.
vgross [Sun, 30 Sep 2018 08:26:40 +0000 (08:26 +0000)]
Add regression test for cmsg size bug.

With help and prodding from bluhm@, mpi@, jca@
and Alexander Markert.

6 years agobump for LibreSSL 2.8.2
bcook [Sun, 30 Sep 2018 02:35:23 +0000 (02:35 +0000)]
bump for LibreSSL 2.8.2

6 years agovmd: don't remove vm if sending failed
pd [Sat, 29 Sep 2018 22:33:09 +0000 (22:33 +0000)]
vmd: don't remove vm if sending failed

Fix a bug where a vm was removed in vmd.c after vmctl send even if sending
failed.
spotted by solene@
ok mlarkin@

6 years agoFix problems with redistribution of routes by route label.
benno [Sat, 29 Sep 2018 19:25:32 +0000 (19:25 +0000)]
Fix problems with redistribution of routes by route label.
Bug report from Jon Williams, jon AT jonwillia DOT ms, thanks.
ok claudio@

6 years agoupdate to 4.1.25
florian [Sat, 29 Sep 2018 17:17:54 +0000 (17:17 +0000)]
update to 4.1.25
OK sthen (on a slightly different configure script version)

6 years agoI forgot to put this in with the 4.1.24 update.
florian [Sat, 29 Sep 2018 17:14:03 +0000 (17:14 +0000)]
I forgot to put this in with the 4.1.24 update.
It is of course not relevant for us but introduces a diff when
the configure script is regenerated on upgrades and this file is
not arround.

6 years agoAllow preemption of functions with protected visibility. Disallowing this
kettenis [Sat, 29 Sep 2018 16:29:12 +0000 (16:29 +0000)]
Allow preemption of functions with protected visibility.  Disallowing this
makes no sense.  Yes it breaks function address equality and therefore
the expectations of the standard C language.  However declaring symbols
with protected visibility isn't standard C in the first place.

Fixes linking non-PIC/PIE code with lld on amd64.

ok millert@

6 years agotest that PWD and OLDPWD are exported
anton [Sat, 29 Sep 2018 16:24:13 +0000 (16:24 +0000)]
test that PWD and OLDPWD are exported

6 years agoTreat NUL like any other byte in the default case; aligns newline count
cheloha [Sat, 29 Sep 2018 16:17:35 +0000 (16:17 +0000)]
Treat NUL like any other byte in the default case; aligns newline count
with that of the '-l' case.

From David Hines on bugs@.

ok millert@

6 years agounmark -beta. There is still development happening, and we aren't
deraadt [Sat, 29 Sep 2018 16:00:44 +0000 (16:00 +0000)]
unmark -beta.  There is still development happening, and we aren't
locked in stone yet, but the clock starts ticking...

6 years agoZap dead/obsolete code
kn [Sat, 29 Sep 2018 15:53:07 +0000 (15:53 +0000)]
Zap dead/obsolete code

Flow labels used to be 24-bit back in 1995 until the IPv6 header format
changed in 1998 when the field size was reduced to 20-bit.

https://tools.ietf.org/html/rfc1883#section-6
https://tools.ietf.org/html/rfc2460#section-6

OK denis deraadt

6 years agoExport the PWD and OLDPWD shell variables as per POSIX.
millert [Sat, 29 Sep 2018 14:13:19 +0000 (14:13 +0000)]
Export the PWD and OLDPWD shell variables as per POSIX.
Previously, these would only be exported if they were present
in the environment when the shell started.  OK deraadt@ anton@ kn@

6 years agoAdjust for the roa-set, origin-set commit that just happend in bgpd
claudio [Sat, 29 Sep 2018 08:14:42 +0000 (08:14 +0000)]
Adjust for the roa-set, origin-set commit that just happend in bgpd

6 years agoROA_UNKNOWN is now ROA_NOTFOUND (as in the RFC).
claudio [Sat, 29 Sep 2018 08:13:56 +0000 (08:13 +0000)]
ROA_UNKNOWN is now ROA_NOTFOUND (as in the RFC).

6 years agoImplement origin validation in bgpd. This introduces two new tables, the
claudio [Sat, 29 Sep 2018 08:11:11 +0000 (08:11 +0000)]
Implement origin validation in bgpd. This introduces two new tables, the
roa-set for RPKI based origin validation and a origin-set which allows to
lookup a source-as / prefix pair.
For RPKI a config can be built like this:
  roa-set {
          165.254.255.0/24 source-as 15562
          193.0.0.0/21 maxlen 24 source-as 3333
  }
  deny from any ovs invalid
  match from any ovs valid set community local-as:42
  match from any ovs not-found set community local-as:43
Origin sets are similar but only match when the source-as / prefix pair is
valid.
  match from any origin-set ARINDB set community local-as:44
Committing this now so that further work can be done in tree.
OK benno@, job@

6 years agoWith the introduction of sets the config that is shipped to the RDE got
claudio [Sat, 29 Sep 2018 07:58:06 +0000 (07:58 +0000)]
With the introduction of sets the config that is shipped to the RDE got
potentially much bigger. In bad cases the SE activated the config way
before the RDE which is not ideal. Introduce IMSG_RECONF_DRAIN which
acts as a barrier and ensures that both childs got all the config.
Only after that the IMSG_RECONF_DONE message is sent activating
the config in the childs more or less simultaneous.
OK benno@

6 years agoIntroduce minimal tracking of announced prefixes. A per peer RB tree tracks
claudio [Sat, 29 Sep 2018 07:43:36 +0000 (07:43 +0000)]
Introduce minimal tracking of announced prefixes. A per peer RB tree tracks
which prefixes were sent out as UPDATE. At withdraw time the RB tree can be
consulted to know if the withdraw actually needs to be sent to the peer.
This replaces the faulty heuristic that was used before and caused either
that unneeded withdraw to be sent or in the worst case failing to send a
necessary withdraw resulting in stuck routes.
OK benno@

6 years agotrim previous;
jmc [Sat, 29 Sep 2018 05:42:38 +0000 (05:42 +0000)]
trim previous;

6 years agoUse atomic operations to update vfc_refcount. Change the field's type
visa [Sat, 29 Sep 2018 04:29:48 +0000 (04:29 +0000)]
Use atomic operations to update vfc_refcount. Change the field's type
to unsigned int.

OK deraadt@

6 years agoIf tpcbench(8) is startet with -r0 it does not print statistics.
bluhm [Fri, 28 Sep 2018 19:01:52 +0000 (19:01 +0000)]
If tpcbench(8) is startet with -r0 it does not print statistics.
But there was still the header line.  Make -r0 really quiet and
document the feature.
OK deraadt@

6 years agoAlways try to build packet reflector on remote machine. It may be
bluhm [Fri, 28 Sep 2018 18:57:37 +0000 (18:57 +0000)]
Always try to build packet reflector on remote machine.  It may be
missing after reinstall.

6 years agoContrary to the sh manual, it is possible to modify the PWD variable
millert [Fri, 28 Sep 2018 18:32:39 +0000 (18:32 +0000)]
Contrary to the sh manual, it is possible to modify the PWD variable
(and this is allowed by POSIX).  OK deraadt@ kn@

6 years agoAdd unveil(2) to sdiff(1) to the following files:
mestre [Fri, 28 Sep 2018 18:21:52 +0000 (18:21 +0000)]
Add unveil(2) to sdiff(1) to the following files:

filename1 - given via args - read permission
filename2 - same as above
tmpdir - if TMPDIR env var is changed, or _PATH_TMP by default -
read/write/create/delete permissions
/usr/bin/diff - the default diff program - execute permission
_PATH_BSHELL - to spawn an EDITOR/VISUAL if -o is used - execute
permission

this diff only applies unveil(2) if -F is not used, meaning that we are not
changing the default diff program to be used since that way we would need to
find where the binary is whereas by default we are sure that the path is
/usr/bin/diff. this will be revisited at a later stage to cover all cases.

feedback and OK millert@ deraadt@

6 years agoExplain how to enable audio recording.
ratchov [Fri, 28 Sep 2018 18:21:31 +0000 (18:21 +0000)]
Explain how to enable audio recording.

help from solene, jmc, and schwarze

6 years agoFix white spaces.
bluhm [Fri, 28 Sep 2018 18:21:26 +0000 (18:21 +0000)]
Fix white spaces.

6 years agoadd missing unveil(2) of an arbitrary kernel (when -N is used), or _PATH_UNIX by
mestre [Fri, 28 Sep 2018 14:03:14 +0000 (14:03 +0000)]
add missing unveil(2) of an arbitrary kernel (when -N is used), or _PATH_UNIX by
default, with read permissions.

report and fix provided by semarie@
OK deraadt@

6 years agoAdd vlan and trunk to arm64's RAMDISK (amd64 parity)
ccardenas [Fri, 28 Sep 2018 13:39:57 +0000 (13:39 +0000)]
Add vlan and trunk to arm64's RAMDISK (amd64 parity)

OK deraadt@ and kettenis@

6 years agoSupport vmd-internal's vmboot with qcow2 disk images.
reyk [Fri, 28 Sep 2018 12:35:32 +0000 (12:35 +0000)]
Support vmd-internal's vmboot with qcow2 disk images.

OK mlarkin@

6 years agoCompress qcow2 open debug messages into a single line
reyk [Fri, 28 Sep 2018 08:29:06 +0000 (08:29 +0000)]
Compress qcow2 open debug messages into a single line

Please avoid tabs and excessive multi-line information with log_debug
as it also goes to syslog.

No functional change.

6 years agoFix copy-pasto to use maxmem instead of maxcpu
reyk [Fri, 28 Sep 2018 08:23:43 +0000 (08:23 +0000)]
Fix copy-pasto to use maxmem instead of maxcpu

Reported by Greg Steuck

OK mlarkin@

6 years agoAdd a cross reference to sysctl(2) to SEE ALSO.
schwarze [Fri, 28 Sep 2018 07:46:45 +0000 (07:46 +0000)]
Add a cross reference to sysctl(2) to SEE ALSO.
People reading the present page will almost certainly need it
because that's where all the sysctl variables are described.

6 years agoadd unveil(2) to tcpdump(8)
mestre [Fri, 28 Sep 2018 06:48:59 +0000 (06:48 +0000)]
add unveil(2) to tcpdump(8)

The following files are opened in the privsep proc, with read permissions, and
therefore need to be unveiled:

- /etc/pf.os - for OS fingerprinting, but only unveiled if -o flag is used
- /etc/ethers - ether_ntohost(3)
- /etc/rpc - getrpcbynumber(3)

Additional files are also opened, but they are either opened before reaching
this code path, or are covered by pledge(2)'s dns promise.

shown and tested by a few people
OK brynet@ deraadt@

6 years agoMove the unions into the rom struct which fixes Coverity CID 1473649 and
kevlo [Fri, 28 Sep 2018 02:38:38 +0000 (02:38 +0000)]
Move the unions into the rom struct which fixes Coverity CID 1473649 and
makes it more readable.

ok stsp@ and jmatthew@

6 years agoDocument retguard and options to disable it.
mortimer [Fri, 28 Sep 2018 00:33:34 +0000 (00:33 +0000)]
Document retguard and options to disable it.
ok deraadt@

6 years agoAdd vmctl stop -a [-fw] option to stop or terminate all running VMs.
reyk [Thu, 27 Sep 2018 17:15:36 +0000 (17:15 +0000)]
Add vmctl stop -a [-fw] option to stop or terminate all running VMs.

This is also be used to simplify the vmd rc stop script.

OK mlarkin@ ccardenas@

6 years agoAdd some extra curlies to make code more legible.
claudio [Thu, 27 Sep 2018 15:53:14 +0000 (15:53 +0000)]
Add some extra curlies to make code more legible.

6 years agounbreak "inet" and "inet6" aliases in filters after rev. 1.333
benno [Thu, 27 Sep 2018 13:48:00 +0000 (13:48 +0000)]
unbreak "inet" and "inet6" aliases in filters after rev. 1.333
ok claudio@

6 years agoCoherently name "struct bridge_iflist" variables `bif'.
mpi [Thu, 27 Sep 2018 12:39:36 +0000 (12:39 +0000)]
Coherently name "struct bridge_iflist" variables `bif'.

ok visa@

6 years agoMake sure the L2 entry is cloned before dereferencing its parent.
mpi [Thu, 27 Sep 2018 12:36:57 +0000 (12:36 +0000)]
Make sure the L2 entry is cloned before dereferencing its parent.

RTF_LOCAL entries or static ARP entries don't have parents, so the logic
was incorrect.  Note that it might be possible to extend the logic to work
with non-cloned L2 entries but the few use cases do not justify the
complexity (yet).

Problem reported & fix tested by Elie Bouttier.

ok bluhm@, visa@, claudio@

6 years agowhitepspace fix
benno [Thu, 27 Sep 2018 12:34:06 +0000 (12:34 +0000)]
whitepspace fix

6 years agoSometimes make picked the wrong rule for the adapted disklabel
bluhm [Thu, 27 Sep 2018 09:11:09 +0000 (09:11 +0000)]
Sometimes make picked the wrong rule for the adapted disklabel
program.  An absolute path seems to fix this.

6 years agoActually I missed the /usr/local default size change in disklabel(8).
bluhm [Thu, 27 Sep 2018 08:56:49 +0000 (08:56 +0000)]
Actually I missed the /usr/local default size change in disklabel(8).
Adjust expected output.

6 years agoDocument how syslogd(8) escapes characters in log lines.
bluhm [Thu, 27 Sep 2018 08:33:25 +0000 (08:33 +0000)]
Document how syslogd(8) escapes characters in log lines.
input jmc@; OK sthen@

6 years agoUse same working directory rules for jobs as new windows rather than
nicm [Thu, 27 Sep 2018 07:43:18 +0000 (07:43 +0000)]
Use same working directory rules for jobs as new windows rather than
always starting in home, GitHub issue 1488.

6 years agoadd unveil(2) to vipw(8)
mestre [Thu, 27 Sep 2018 06:52:15 +0000 (06:52 +0000)]
add unveil(2) to vipw(8)

The files needed to be unveiled directly or indirectly via libutil are the
following:
- _PATH_MASTERPASSWD_LOCK - write/create permissions
- _PATH_MASTERPASSWD - read permission
- _PATH_BSHELL - execute permission
- _PATH_PWD_MKDB - execute permission

_PATH_MASTERPASSWD gets read and then _PATH_MASTERPASSWD_LOCK is created and
the content of the former is written on the latter. After this _PATH_BSHELL
spawns an EDITOR (vi(1) by default) and at the end then _PATH_PWD_MKDB is ran
to update the _PATH_MASTERPASSWD based in what was actually changed in
_PATH_MASTERPASSWD_LOCK.

OK deraadt@

6 years agoKERN_CPTIME2: set ENODEV if the CPU is offline.
cheloha [Wed, 26 Sep 2018 17:23:13 +0000 (17:23 +0000)]
KERN_CPTIME2: set ENODEV if the CPU is offline.

This lets userspace distinguish between idle CPUs and those that are
not schedulable because hw.smt=0.

A subsequent commit probably needs to add documentation for this
to sysctl.2 (and perhaps elsewhere) after the dust settles.

Also included here are changes to systat(1) and top(1) that account
for the ENODEV case and adjust behavior accordingly:

 - systat(1)'s cpu view prints placeholder marks ('-') instead of
   percentages for each state if the given CPU is offline.

 - systat(1)'s vmstat view checks for offline CPUs when computing the
   machine state total and excludes them, so the CPU usage graph
   only represents the states for online CPUs.

 - top(1) does not draw CPU rows for offline CPUs when the view is
   redrawn.  If CPUs "go offline", percentages for each state are
   replaced by placeholder marks ('-'); the view will need to be
   redrawn to remove these rows.  If CPUs "go online" the view will
   need to be redrawn to show these new CPUs.  In "combined CPU" mode,
   the count and the state totals only represent online CPUs.

Ports using KERN_CPTIME2 will need to be updated.  The changes
described above to make systat(1) and top(1) aware of the ENODEV
case *and* gracefully handle a changing HW_NCPUONLINE while the
application is running are not necessarily appropriate for each
and every port.

The changes described above are so extensive in part to demonstrate
one way a program *might* be made robust to changing CPU availability.
In particular, changing hw.smt after boot is an extremely rare event,
and this needs to be weighed when updating ports.

The logic needed to account for the KERN_CPTIME2 ENODEV case is
very roughly:

if (sysctl(...) == -1) {
if (errno != ENODEV) {
/* Actual error occurred. */
} else {
/* CPU is offline. */
}
} else {
/* CPU is online and CPU states were set by sysctl(2). */
}

Prompted by deraadt@.  Basic idea for ENODEV from kettenis@.  Discussed at
length with kettenis@.  Additional testing by tb@.

No complaints from hackers@ after a week.

ok kettenis@, "I think you should commit [now]" deraadt@

6 years agoUse more appropiate types/limits around strtonum()
kn [Wed, 26 Sep 2018 16:39:19 +0000 (16:39 +0000)]
Use more appropiate types/limits around strtonum()

Replace `long long id' with appropiate types and names, use smaller limits
where applicable and move variable declarations up out of loops.

This makes the code clearer and a tad simpler while staying consistent
across databases.

Feedback and OK millert

6 years agotreat NOTIMP as NO_DATA in response to MX query: fallback to hostname lookup
eric [Wed, 26 Sep 2018 16:28:34 +0000 (16:28 +0000)]
treat NOTIMP as NO_DATA in response to MX query: fallback to hostname lookup
instead of bouncing the mail.

ok gilles@