openbsd
5 years agocorrectly retrieve envelope strings. fixes mailq output.
eric [Mon, 14 Jan 2019 09:37:40 +0000 (09:37 +0000)]
correctly retrieve envelope strings. fixes mailq output.

ok gilles@

5 years agoUntimely spring cleaning:
schwarze [Mon, 14 Jan 2019 09:06:04 +0000 (09:06 +0000)]
Untimely spring cleaning:
* Garbage collect useless hand-rolled lookup tables.
* Merge one-line helper functions into callers.
* Garbage collect obfuscating macros.
* Fix one format string error (%d used for u_int).
* Garbage collect setlocale(3) and <locale.h>.
* Garbage collect several unused constants.
* Minus 45 LOC, no functional change.

As noticed by tedu@, the lookup table "table" was used uninitialized.
But since it was only used as a pre-matching optimization and the real
string comparison is done further down the line, that bug probably did
not cause wrong results but merely ruined -i performance.

Code review triggered by a naive question from Jan Stary.
OK deraadt@ tedu@

5 years agoFix three more buglets:
schwarze [Mon, 14 Jan 2019 08:48:16 +0000 (08:48 +0000)]
Fix three more buglets:
1. Another off-by-one: if a mail file name ends in an (escaped)
percent sign, do not forget to check whether the next byte is the
percent sign introducing the message (MAILPATH='filename\%%msg').
2. If the message is empty, use the default message rather than
printing a blank line (MAILPATH='filename%').
3. If the file name is empty, don't bother with mballoc(): the
subsequent stat(2) can never succeed.  (MAILPATH='%msg').
Found while reviewing the previous commit by tedu@.
OK tedu@.

5 years agomention WN821N v5, capitalise TP-LINK consistently
jmatthew [Mon, 14 Jan 2019 06:56:41 +0000 (06:56 +0000)]
mention WN821N v5, capitalise TP-LINK consistently

5 years agoUnbreak tree. Last minute changes are evil.
otto [Mon, 14 Jan 2019 06:49:42 +0000 (06:49 +0000)]
Unbreak tree. Last minute changes are evil.

5 years agomatch on TP-Link WN821N v5 (RTL8192EU), tested by Jesper Wallin
jmatthew [Mon, 14 Jan 2019 06:25:26 +0000 (06:25 +0000)]
match on TP-Link WN821N v5 (RTL8192EU), tested by Jesper Wallin

5 years agoThere are cases where a program doing dns requests wants to set the
otto [Mon, 14 Jan 2019 06:23:06 +0000 (06:23 +0000)]
There are cases where a program doing dns requests wants to set the
Checking Disabled flag. Introduce a RES flag to do so. ok krw@
deraadt@ eric@

5 years agoMake apply_ignore_list(), set_default_hostname(),
krw [Mon, 14 Jan 2019 04:54:46 +0000 (04:54 +0000)]
Make apply_ignore_list(), set_default_hostname(),
set_default_client_identifier() and read_resolv_conf_tail() local to
clparse.c and just call them from read_conf().

5 years agoAbstract allocation and initialization of config global
krw [Mon, 14 Jan 2019 04:05:42 +0000 (04:05 +0000)]
Abstract allocation and initialization of config global
variable into init_config() and just call it from
read_conf().

5 years agoFix unveil issue noticed by kn@ where unveil does not notice covering
beck [Mon, 14 Jan 2019 04:02:39 +0000 (04:02 +0000)]
Fix unveil issue noticed by kn@ where unveil does not notice covering
unveil matches when .. is used correctly.  Also adds regress based
upon his test program for the same issue.

5 years agoregen
jmatthew [Mon, 14 Jan 2019 03:28:51 +0000 (03:28 +0000)]
regen

5 years agoadd TP-Link WN821N v5 (RTL8192EU), from Jesper Wallin
jmatthew [Mon, 14 Jan 2019 03:28:03 +0000 (03:28 +0000)]
add TP-Link WN821N v5 (RTL8192EU), from Jesper Wallin

5 years agoset_default_client_identifier() only needs the
krw [Mon, 14 Jan 2019 03:05:33 +0000 (03:05 +0000)]
set_default_client_identifier() only needs the
struct ether_addr (a.k.a. ifi->hw_address) rather
than the entire struct interface_info.

5 years agoCheck NULLness of ignore list inside apply_ignore_list() and not
krw [Mon, 14 Jan 2019 02:51:29 +0000 (02:51 +0000)]
Check NULLness of ignore list inside apply_ignore_list() and not
before calling it.

5 years agohint that kern.clockrate is the userland sysctl name by referring to
tedu [Mon, 14 Jan 2019 02:05:46 +0000 (02:05 +0000)]
hint that kern.clockrate is the userland sysctl name by referring to
KERN_CLOCKRATE instead of the returned type.

5 years agodo not peek before the beginning of a string
tedu [Mon, 14 Jan 2019 00:59:19 +0000 (00:59 +0000)]
do not peek before the beginning of a string
ok deraadt schwarze tb

5 years agoSkip open of "network" ttys because they permanently retain the (large)
deraadt [Sun, 13 Jan 2019 23:40:30 +0000 (23:40 +0000)]
Skip open of "network" ttys because they permanently retain the (large)
tty buffers after that.
from miod

5 years agoMap SHT_LLVM_ADDRSIG to string
guenther [Sun, 13 Jan 2019 23:33:28 +0000 (23:33 +0000)]
Map SHT_LLVM_ADDRSIG to string

ok kettenis@ deraadt@

5 years agoAbstract /etc/resolv.conf.tail reading out of main()
krw [Sun, 13 Jan 2019 23:15:31 +0000 (23:15 +0000)]
Abstract /etc/resolv.conf.tail reading out of main()
and into a read_resolv_conf_tail() in clparse.c.

5 years agoIgnore LLVM 7's ADDRSIG section.
guenther [Sun, 13 Jan 2019 23:08:21 +0000 (23:08 +0000)]
Ignore LLVM 7's ADDRSIG section.

Problem reported by bluhm@
ok kettenis@

5 years agoRemove redundant RF switch notice
kn [Sun, 13 Jan 2019 22:57:37 +0000 (22:57 +0000)]
Remove redundant RF switch notice

Toggling the hardware switch already gets communicated through
"iwn0: RF switch: radio disabled" and "iwn0: RF switch: radio enabled"
so stating in between that the transmitter is turned off does not provide
any further information.

iwn_stop() effects the RUNNING flag and controls power, but does not
pull the interface up or down, so adjust the misleading comment while
here.

OK stsp, tested by sashan

5 years agoWarn against using any categories but LC_CTYPE in setlocale(3) and
schwarze [Sun, 13 Jan 2019 22:57:08 +0000 (22:57 +0000)]
Warn against using any categories but LC_CTYPE in setlocale(3) and
list many (hopefully the most important) functions affected by the
locale, such that the CAVEATS sections in individual manual pages
can be kept shorter in the future;
basic idea from millert@; feedback and OK jmc@; OK deraadt@.

5 years agoWhite space nits.
krw [Sun, 13 Jan 2019 21:55:32 +0000 (21:55 +0000)]
White space nits.

5 years agoShuffle apply_ignore_list(), set_default_client_identifier() and
krw [Sun, 13 Jan 2019 18:45:21 +0000 (18:45 +0000)]
Shuffle apply_ignore_list(), set_default_client_identifier() and
set_default_host_name() to clparse.c as they are part of config
initialization. First step in cleanup of startup  logic.

5 years agoHandle card detect GPIO.
visa [Sun, 13 Jan 2019 16:45:44 +0000 (16:45 +0000)]
Handle card detect GPIO.

5 years agoPass timeout in seconds instead of ticks.
visa [Sun, 13 Jan 2019 16:38:43 +0000 (16:38 +0000)]
Pass timeout in seconds instead of ticks.

5 years agospelling error fixes; from Claus Assmann
deraadt [Sun, 13 Jan 2019 16:37:29 +0000 (16:37 +0000)]
spelling error fixes; from Claus Assmann

5 years agoRestore .Xr to pthread_sigmask
jca [Sun, 13 Jan 2019 16:16:43 +0000 (16:16 +0000)]
Restore .Xr to pthread_sigmask

Pointed out by naddy@

5 years agoFix an off-by-one in pfkeyv2_sysctl_policydumper() and get rid of a
mpi [Sun, 13 Jan 2019 14:31:55 +0000 (14:31 +0000)]
Fix an off-by-one in pfkeyv2_sysctl_policydumper() and get rid of a
workaround for this bug.

ok visa@

5 years agoValidate the number of expected interfaces in *match() and claim them
mpi [Sun, 13 Jan 2019 14:30:16 +0000 (14:30 +0000)]
Validate the number of expected interfaces in *match() and claim them
during *attach().

This allows us to get rid of two calls to usbd_device2interface_handle()
that could fail later.

ok ratchov@, jcs@

5 years agoValidate that the interface passed to *match() is the expected one
mpi [Sun, 13 Jan 2019 14:27:15 +0000 (14:27 +0000)]
Validate that the interface passed to *match() is the expected one
instead of calling usbd_device2interface_handle() during *attach().

ok stsp@

5 years agodocument how program names are extracted from log lines
schwarze [Sun, 13 Jan 2019 11:07:47 +0000 (11:07 +0000)]
document how program names are extracted from log lines
in order to select syslog.conf(5) line blocks

5 years agoWhen parsing log lines in order to select syslog.conf(5) line blocks, support
schwarze [Sun, 13 Jan 2019 10:42:51 +0000 (10:42 +0000)]
When parsing log lines in order to select syslog.conf(5) line blocks, support
program names containing period ('.') and underscore ('_') ASCII characters.
Missing feature reported by and patch tested by
Kawashima underscore James at yahoo dot co dot jp.
"Makes sense." deraadt@

5 years agoCheck for the CPU architecture and not the system architecture when
naddy [Sat, 12 Jan 2019 23:36:35 +0000 (23:36 +0000)]
Check for the CPU architecture and not the system architecture when
tweaking the protection flags.  ok phessler@ deraadt@

5 years agoEnable ohci at fdt.
kettenis [Sat, 12 Jan 2019 19:37:16 +0000 (19:37 +0000)]
Enable ohci at fdt.

5 years agoAdd missing OHCI-related clocks.
kettenis [Sat, 12 Jan 2019 19:08:02 +0000 (19:08 +0000)]
Add missing OHCI-related clocks.

5 years agosync
visa [Sat, 12 Jan 2019 17:14:02 +0000 (17:14 +0000)]
sync

5 years agoAdd a manual page for octgpio(4).
visa [Sat, 12 Jan 2019 17:07:16 +0000 (17:07 +0000)]
Add a manual page for octgpio(4).

5 years agoUse acpidump -q to avoid message about ACPI information not being found.
kettenis [Sat, 12 Jan 2019 17:05:00 +0000 (17:05 +0000)]
Use acpidump -q to avoid message about ACPI information not being found.
Many arm64 systems use device trees instead of ACPI and acpidump is
expectected to fail on those systems.  And vmm(4) doesn't provide ACPI
information either.

ok deraadt@

5 years agoAdd -q flag to suppress the message that ACPI information can't be found.
kettenis [Sat, 12 Jan 2019 17:01:31 +0000 (17:01 +0000)]
Add -q flag to suppress the message that ACPI information can't be found.

ok deraadt@

5 years agoAdd a driver for OCTEON GPIO controller.
visa [Sat, 12 Jan 2019 16:59:38 +0000 (16:59 +0000)]
Add a driver for OCTEON GPIO controller.

5 years agoFix potential use-after-free if xfer allocation fails when otus(4) attaches.
stsp [Sat, 12 Jan 2019 16:12:10 +0000 (16:12 +0000)]
Fix potential use-after-free if xfer allocation fails when otus(4) attaches.
ok mpi@ ian@

5 years agoMake the scan loop in otus(4) terminate properly when the interface
stsp [Sat, 12 Jan 2019 16:11:22 +0000 (16:11 +0000)]
Make the scan loop in otus(4) terminate properly when the interface
is going down. Problem reported by ian@.
ok mpi@ ian@

5 years agodelete <locale.h>
schwarze [Sat, 12 Jan 2019 15:33:17 +0000 (15:33 +0000)]
delete <locale.h>
which was left behind during gettext removal (rev. 1.5) in 2015;
no object change;
patch from Jan Stary <hans at stare dot cz>

5 years agoAttach the AHCI controller bridge driver even if the AHCI controller
visa [Sat, 12 Jan 2019 13:50:52 +0000 (13:50 +0000)]
Attach the AHCI controller bridge driver even if the AHCI controller
node is not present in fdt.

5 years agoMove sigwait(3) from libpthread to libc
jca [Sat, 12 Jan 2019 00:16:03 +0000 (00:16 +0000)]
Move sigwait(3) from libpthread to libc

POSIX wants it in libc, that's where the function can be found on other
systems.  Reported by naddy@, input from naddy@ and guenther@.
"looks ok" guenther@, ok deraadt@

Note: riding the libc/libpthread major cranks earlier today.

5 years agodisable the correct performance options, per-architecture
deraadt [Fri, 11 Jan 2019 23:25:22 +0000 (23:25 +0000)]
disable the correct performance options, per-architecture
with naddy, ok guenther mortimer

5 years agosome consistency fixes, and add abcrtc to iic; ok patrick
jmc [Fri, 11 Jan 2019 20:39:46 +0000 (20:39 +0000)]
some consistency fixes, and add abcrtc to iic; ok patrick

5 years agosync
deraadt [Fri, 11 Jan 2019 19:01:01 +0000 (19:01 +0000)]
sync

5 years agosync
deraadt [Fri, 11 Jan 2019 18:52:41 +0000 (18:52 +0000)]
sync

5 years agomincore() is a relic from the past, exposing physical machine information
deraadt [Fri, 11 Jan 2019 18:46:30 +0000 (18:46 +0000)]
mincore() is a relic from the past, exposing physical machine information
about shared resources which no program should see.  only a few pieces of
software use it, generally poorly thought out.  they are being fixed, so
mincore() can be deleted.
ok guenther tedu jca sthen, others

5 years agoSet RUNNING flag when RF switch is enabled
kn [Fri, 11 Jan 2019 17:12:38 +0000 (17:12 +0000)]
Set RUNNING flag when RF switch is enabled

Toggling the hardware kill switch shuts radio power on/off accordingly.
On UP and RUNNING interfaces disabling removes the RUNNING flag,
but enabling back again would leave the flag unset.

Get the interface running when switching it back on iff it's up
to ensure seemless operation without the need for `ifconfig iwn0 up'.

For this, iwn_init_task() will do the right thing so schedule it when
receiving the appropiate interrupt.

Tested on my X230 with
    "Intel Centrino Advanced-N 6205" rev 0x34: msi, MIMO 2T2R, MoW

OK stsp who also tested it with
    "Intel Centrino Advanced-N 6200" rev 0x35: msi, MIMO 2T2R, MoW

iwm(4) already behaves this way.

5 years agoImprove error reporting when a file given on the command line
schwarze [Fri, 11 Jan 2019 17:03:43 +0000 (17:03 +0000)]
Improve error reporting when a file given on the command line
cannot be opened:
* Mention the filename.
* Report the errno for the file itself, not the one with .gz appended.

5 years agodo not access a NULL pointer when formatting a completely empty document
schwarze [Fri, 11 Jan 2019 16:35:39 +0000 (16:35 +0000)]
do not access a NULL pointer when formatting a completely empty document

5 years agowe removed the . in the spec long ago
espie [Fri, 11 Jan 2019 15:49:08 +0000 (15:49 +0000)]
we removed the . in the spec long ago

5 years agosync
deraadt [Fri, 11 Jan 2019 15:43:41 +0000 (15:43 +0000)]
sync

5 years agoRemove the HTML title= attributes which harmed accessibility and
schwarze [Fri, 11 Jan 2019 12:44:10 +0000 (12:44 +0000)]
Remove the HTML title= attributes which harmed accessibility and
violated the principle of separation of content and presentation.
Instead, implement the tooltips purely in CSS.
Thanks to John Gardner <gardnerjohng at gmail dot com> for
suggesting most of the styling in the new ::before rules.

5 years agoSimilar CAVEATS regarding LC_NUMERIC as was just committed
schwarze [Fri, 11 Jan 2019 10:20:38 +0000 (10:20 +0000)]
Similar CAVEATS regarding LC_NUMERIC as was just committed
to wprintf(3) with OK cheloha@ tedu@; also triggered by a
smaller diff from Jan Stary <hans at stare dot cz>.

5 years agoClarify that OpenBSD ignores the dangerous category LC_NUMERIC,
schwarze [Fri, 11 Jan 2019 09:53:26 +0000 (09:53 +0000)]
Clarify that OpenBSD ignores the dangerous category LC_NUMERIC,
and explain best practice for portable programs below CAVEATS.
Triggered by a smaller diff from Jan Stary <hans at stare dot cz>.
Emphatic OKs from cheloha@ and tedu@.

5 years agoAdd manpage for imxsrc(4)
patrick [Fri, 11 Jan 2019 08:32:28 +0000 (08:32 +0000)]
Add manpage for imxsrc(4)

5 years agoAdd manpage for abcrtc(4)
patrick [Fri, 11 Jan 2019 08:25:34 +0000 (08:25 +0000)]
Add manpage for abcrtc(4)

Requested by kettenis@

5 years agoAdd i.MX8MQ support to dwpcie(4). Since the i.MX8MQ does seem to
patrick [Fri, 11 Jan 2019 08:03:24 +0000 (08:03 +0000)]
Add i.MX8MQ support to dwpcie(4).  Since the i.MX8MQ does seem to
use MSI using dwpcie(4) instead of the GIC, MSIs are disabled for
that platform until implemented.

ok kettenis@

5 years agoimxsrc(4), a driver for the i.MX System Reset Controller. We will
patrick [Fri, 11 Jan 2019 08:02:19 +0000 (08:02 +0000)]
imxsrc(4), a driver for the i.MX System Reset Controller.  We will
use this to assert the reset pins for e.g. the PCIe controller.

ok kettenis@

5 years agoAdd support for changing the parent of the PCIe clocks. We will
patrick [Fri, 11 Jan 2019 08:00:34 +0000 (08:00 +0000)]
Add support for changing the parent of the PCIe clocks.  We will
use this for setting the PCIe clocks to the correct frequency.

ok kettenis@

5 years agoMove the placement of pmap_kernel's toplevel PML4 page
mlarkin [Fri, 11 Jan 2019 06:25:06 +0000 (06:25 +0000)]
Move the placement of pmap_kernel's toplevel PML4 page

This change moves the PML4 for pmap_kernel elsewhere during early boot.
Lower levels of pmap_kernel will be moved in subsequent changes, but there
are other pmap changes coming that need to be integrated first.

In snaps for 3 days, no fallout seen.

ok deraadt and substantial input and help from guenther@

cvs: ----------------------------------------------------------------------

5 years agogetsockopt(2) recv(2) rmdir(2) and send(2) were present and implemented
jsg [Fri, 11 Jan 2019 06:10:13 +0000 (06:10 +0000)]
getsockopt(2) recv(2) rmdir(2) and send(2) were present and implemented
in 4.1c

ok schwarze@

5 years agoDefuse `-F all -i interface'
kn [Fri, 11 Jan 2019 03:09:24 +0000 (03:09 +0000)]
Defuse `-F all -i interface'

Flushing all filter parameters does not make sense on one specific
interface only as already noted.  However, the main ruleset as well as
all tables were still cleared on such invalid usage.

Furthermore, an empty interface name was treated like no interface at
all, hence source tracking entries, statistics and interface flags were
cleared also.

Immediately error out if `-i' is given regardless of its argument before
flushing anything.

OK sashan

5 years agoWhen creating tables inside anchors, pfctl warned about namespace
kn [Fri, 11 Jan 2019 01:56:54 +0000 (01:56 +0000)]
When creating tables inside anchors, pfctl warned about namespace
collisions with global tables, but only in certain cases and with
limited information sometimes leaving users clueless.

Deferring the check to process_tabledefs() where tables are eventually
created, both anchor and table name are known which allows for checking
all existing anchors.

With this, warn on all duplicates even in dry-runs (`-n') and print
quoted names so they can be copied to fix configurations right away.

No functional change in parsing or ruleset production.

Discussed with and OK sashan

5 years agoZap unnused iface function parameter from pfctl_kill_src_nodes()
kn [Thu, 10 Jan 2019 22:22:51 +0000 (22:22 +0000)]
Zap unnused iface function parameter from pfctl_kill_src_nodes()

Killing source tracking entries per interface does not make sense and
`-i interface' along with `-K key' is completely ignored anyway.

There since import in 2006, probably just copy/pasta.

OK sashan

5 years agoMake mincore lie. The nature of shared memory means it can spy on what
tedu [Thu, 10 Jan 2019 21:55:26 +0000 (21:55 +0000)]
Make mincore lie. The nature of shared memory means it can spy on what
another process is doing. We don't want that, so instead have it
always return that memory is in core.
ok deraadt kettenis

5 years agosync
deraadt [Thu, 10 Jan 2019 20:46:25 +0000 (20:46 +0000)]
sync

5 years agoHold a read lock on the map while doing the actual device I/O during in
kettenis [Thu, 10 Jan 2019 20:26:34 +0000 (20:26 +0000)]
Hold a read lock on the map while doing the actual device I/O during in
physio(9) to prevent another thread from unmapping the memory and triggering
an assertion or even corruption random physical memory pages.

ok deraadt@

Should fix:
Reported-by: syzbot+b8e7faf688f8c9d341b1@syzkaller.appspotmail.com
Reported-by: syzbot+b6a9255faa0605669432@syzkaller.appspotmail.com
5 years agoan alloca() snuck into the tree. We don't use alloca() in our tree unless
deraadt [Thu, 10 Jan 2019 19:21:02 +0000 (19:21 +0000)]
an alloca() snuck into the tree.  We don't use alloca() in our tree unless
it is entirely unavoidable (for example libc/*/exec.c), because any erroneous
size controlled by an attacker turns into a known-location object placement
in a very dangerous region.  So use malloc() instead.

5 years agounbreak vmd build
sf [Thu, 10 Jan 2019 18:59:56 +0000 (18:59 +0000)]
unbreak vmd build

include new virtio_pcireg.h header

5 years agoProperly implement (as far as we can) Event()/Signal()/Wait() AML operations.
kettenis [Thu, 10 Jan 2019 18:50:32 +0000 (18:50 +0000)]
Properly implement (as far as we can) Event()/Signal()/Wait() AML operations.

ok mpi@, tedu@, deraadt@

5 years agoMove default numer of pools in the multi-threaded case to 8. Various tests
otto [Thu, 10 Jan 2019 18:47:05 +0000 (18:47 +0000)]
Move default numer of pools in the multi-threaded case to 8. Various tests
by me and others indicate that it is the optimum.

5 years agoMake the "not my pool" searching loop a tiny bit smarter, while
otto [Thu, 10 Jan 2019 18:45:33 +0000 (18:45 +0000)]
Make the "not my pool" searching loop a tiny bit smarter, while
making the number of pools variable.  Do not document the malloc
conf settings atm, don't know yet if they will stay.  Thanks to all
the testers. ok deraadt@

5 years agoregen pcidevs*.h
sf [Thu, 10 Jan 2019 18:36:53 +0000 (18:36 +0000)]
regen pcidevs*.h

5 years agoAdd virtio 1.x PCI IDs
sf [Thu, 10 Jan 2019 18:35:56 +0000 (18:35 +0000)]
Add virtio 1.x PCI IDs

Everything above 0x1040 is 1.x only.

Also tweak descriptoin of memory balloon device. There will be a memory
device, too

ok mlarkin@

5 years agoFix previous
sf [Thu, 10 Jan 2019 18:22:17 +0000 (18:22 +0000)]
Fix previous

It accidentally contained a part of a different diff.

5 years agoMove some PCI-specific defines to a new virtio_pcireg.h file
sf [Thu, 10 Jan 2019 18:11:42 +0000 (18:11 +0000)]
Move some PCI-specific defines to a new virtio_pcireg.h file

Also add some virtio 1.0 status and feature bits

5 years agoRemove some more code if VIRTIO_DEBUG is 0
sf [Thu, 10 Jan 2019 18:06:56 +0000 (18:06 +0000)]
Remove some more code if VIRTIO_DEBUG is 0

5 years agoMove some common defines to virtiovar.h
sf [Thu, 10 Jan 2019 18:05:43 +0000 (18:05 +0000)]
Move some common defines to virtiovar.h

And fix some comments

5 years agosettime: Don't cancel ongoing adjtime(2) until after full permission checks
cheloha [Thu, 10 Jan 2019 17:54:11 +0000 (17:54 +0000)]
settime: Don't cancel ongoing adjtime(2) until after full permission checks

ok jca@ visa@ guenther@ deraadt@

5 years agoRevert nanosleep(2) loop introduced in v1.25.
cheloha [Thu, 10 Jan 2019 16:41:10 +0000 (16:41 +0000)]
Revert nanosleep(2) loop introduced in v1.25.

Now that nanosleep(2) handles the full input range transparently there
is no longer a 100 million second upper bound and we can remove this loop.

ok phessler@ jca@ visa@

5 years ago"AF_* values are *almost* always the correct choice, particularly with
krw [Thu, 10 Jan 2019 14:49:07 +0000 (14:49 +0000)]
"AF_* values are *almost* always the correct choice, particularly with
POSIX APIs".

Also sprach guenther@. So switch PF_ROUTE to AF_ROUTE in socket() and
setsockopt() calls. Keep PF_ROUTE in sysctl(2) uses. adding a comment
for future visitors,

Also replace PF_UNSPEC with 0 in socketpair(), as socketpair(2) points
out this is the only sensible value.

Cluebat from and ok guenther@

5 years agoRevert back previous commit and stop including strings.h
mestre [Thu, 10 Jan 2019 12:44:54 +0000 (12:44 +0000)]
Revert back previous commit and stop including strings.h

Use memset(3) instead of bzero(3) since POSIX recommends using the former and
because it's also more portable (conforms to ANSI C standard)

OK tedu@ tb@

5 years agochange order of pledge(2) promises to the canonical form.
mestre [Thu, 10 Jan 2019 12:13:44 +0000 (12:13 +0000)]
change order of pledge(2) promises to the canonical form.
while here also use NULL as its second argument, instead of "", like it's
done everywhere else in the tree.

OK florian@

5 years agounbound-anchor needs to talk to the internet and write to the trust
florian [Thu, 10 Jan 2019 11:21:04 +0000 (11:21 +0000)]
unbound-anchor needs to talk to the internet and write to the trust
anchor file (create it if it doesn't exist).
pledge & unveil accordingly
OK sthen

5 years agoreport errno in debug logs and other minor cleanups.
eric [Thu, 10 Jan 2019 07:40:52 +0000 (07:40 +0000)]
report errno in debug logs and other minor cleanups.

ok gilles@

5 years agoAfter years of gnashing of teeth, i finally found a way to avoid
schwarze [Thu, 10 Jan 2019 07:39:39 +0000 (07:39 +0000)]
After years of gnashing of teeth, i finally found a way to avoid
having to write empty list elements for non-compact .Bl -tag lists:

1. Add margin-bottom to the <dd>.
Note that margin-top on the <dt> doesn't work because it would put
a short <dt> lower than the <dd>; margin-bottom on the <dt> doesn't
work because it would put vertical space before the <dd> for a long
<dt>; and margin-top on the <dd> doesn't work because it would put
a short <dt> higher than the <dd>.  Only margin-bottom on the <dd>
has none of these adverse effects.

2. Of course, margin-bottom on the <dd> fails to take care of the
vertical spacing before the first list element, so implement that
separately by margin-top on the <dl>.

3. For .Bl -tag -compact, reset both to zero.

5 years agoInitializers for file-scope static variables should be compile-time
schwarze [Thu, 10 Jan 2019 06:27:23 +0000 (06:27 +0000)]
Initializers for file-scope static variables should be compile-time
constants, and while stderr is a compile-time constant in OpenBSD,
Kelvin Sherlock <ksherlock at gmail dot com> reports that it isn't
on some other systems, for example on FreeBSD or Linux.
So do the initialization by calling mandoc_msg_setoutfile()
from main() instead.

5 years agoUse efifb_stolen() to prevent radeondrm from using aperture memory
jsg [Thu, 10 Jan 2019 01:20:02 +0000 (01:20 +0000)]
Use efifb_stolen() to prevent radeondrm from using aperture memory
overlapping the framebuffer.   Prompted by ring tests failing.
Diagnosed, fix suggested by and ok kettenis@

5 years agoadd efifb_stolen() to get the size of the efifb framebuffer
jsg [Thu, 10 Jan 2019 01:16:29 +0000 (01:16 +0000)]
add efifb_stolen() to get the size of the efifb framebuffer
suggested by and ok kettenis@

5 years agoDrop dead links to loria.fr and cvshome.org
jca [Thu, 10 Jan 2019 00:41:40 +0000 (00:41 +0000)]
Drop dead links to loria.fr and cvshome.org

Pointed out by Matteo Niccoli, ok bluhm@ sthen@

5 years agoPrinting hex values with right adjustment makes it easier to compare
bluhm [Wed, 9 Jan 2019 18:11:22 +0000 (18:11 +0000)]
Printing hex values with right adjustment makes it easier to compare
corresponding digits.  So the change the ddb x/x output.
OK sashan@ deraadt@ visa@ mpi@

5 years agoDelay keyword expansion in co until after the locks have been resolved.
joris [Wed, 9 Jan 2019 18:00:45 +0000 (18:00 +0000)]
Delay keyword expansion in co until after the locks have been resolved.

This way the expansion can happen with the correct values and files do not
show up as modified.

5 years agoWhen expanding $Log$ make sure a newline is added if rd_log has none.
joris [Wed, 9 Jan 2019 17:57:05 +0000 (17:57 +0000)]
When expanding $Log$ make sure a newline is added if rd_log has none.
This can happen on new RCS files.

Fixes $Log$ keyword expansion.

5 years agoMake sure rcs_lock_add() and rcs_lock_remove() properly update the
joris [Wed, 9 Jan 2019 17:55:28 +0000 (17:55 +0000)]
Make sure rcs_lock_add() and rcs_lock_remove() properly update the
rd_lock member of the matching delta.

Other keyword substitution will not properly work in cases where the
RCS file did not have a lock for the revision yet or if the lock is
being removed.

5 years agoUse PF_ROUTE consistently rather than tossing in
krw [Wed, 9 Jan 2019 16:48:36 +0000 (16:48 +0000)]
Use PF_ROUTE consistently rather than tossing in
a couple of AF_ROUTE.