openbsd
9 years agoRename the struct pollfd array, "set" -> "pfd"
jca [Mon, 26 Oct 2015 00:25:45 +0000 (00:25 +0000)]
Rename the struct pollfd array, "set" -> "pfd"

"set" reminds of select(2) fd_set, and is never used elsewhere in the
tree as a name for a pollfd array.  No functional change.

9 years agoThose variables should be local to the functions where they are used.
jca [Mon, 26 Oct 2015 00:20:44 +0000 (00:20 +0000)]
Those variables should be local to the functions where they are used.

Gets rid of a lot of warnings with -Wshadow.  No functional change.

9 years agospace before punctuation;
jmc [Mon, 26 Oct 2015 00:15:37 +0000 (00:15 +0000)]
space before punctuation;

9 years agoKill unused variable and function.
jca [Mon, 26 Oct 2015 00:05:47 +0000 (00:05 +0000)]
Kill unused variable and function.

No functional change.

9 years agohms() returns a pointer to static storage, annotate the return type with "const"
jca [Sun, 25 Oct 2015 23:53:35 +0000 (23:53 +0000)]
hms() returns a pointer to static storage, annotate the return type with "const"

No functional change.

9 years agoCorrectly print size_t/time_t.
jca [Sun, 25 Oct 2015 23:50:23 +0000 (23:50 +0000)]
Correctly print size_t/time_t.

No functional change.

9 years agoExpand tildes in filenames passed to -i before checking whether or not the
dtucker [Sun, 25 Oct 2015 23:42:00 +0000 (23:42 +0000)]
Expand tildes in filenames passed to -i before checking whether or not the
identity file exists.  This means that if the shell doesn't do the expansion
(eg because the option and filename were given as a single argument) then
we'll still add the key.  bz#2481, ok markus@

9 years agoPlug memory leak introduced in r1.15.
jca [Sun, 25 Oct 2015 23:41:50 +0000 (23:41 +0000)]
Plug memory leak introduced in r1.15.

No functional change.

9 years agoDo not prepend "exec" to the shell command run by "Match exec" in a config
dtucker [Sun, 25 Oct 2015 23:14:03 +0000 (23:14 +0000)]
Do not prepend "exec" to the shell command run by "Match exec" in a config
file.  It's an unnecessary optimization from repurposed ProxyCommand code
and prevents some things working with some shells.  bz#2471, pointed out
by res at qoxp.net.  ok markus@

9 years agoNo longer create /var/run/ftpd.pid in daemon mode; OK jung@ jca@
millert [Sun, 25 Oct 2015 23:10:53 +0000 (23:10 +0000)]
No longer create /var/run/ftpd.pid in daemon mode; OK jung@ jca@

9 years agoThose two functions take no parameters, thus /* ARGSUSED */ is meaningless.
jca [Sun, 25 Oct 2015 23:10:32 +0000 (23:10 +0000)]
Those two functions take no parameters, thus /* ARGSUSED */ is meaningless.

No functional change.

9 years agoSync surrounding code after reallocarray introduction.
jca [Sun, 25 Oct 2015 23:03:07 +0000 (23:03 +0000)]
Sync surrounding code after reallocarray introduction.

No functional change.

9 years agoRename allocopy() to xstrdup(), and make use of strdup(3).
jca [Sun, 25 Oct 2015 22:57:09 +0000 (22:57 +0000)]
Rename allocopy() to xstrdup(), and make use of strdup(3).

No functional change.

9 years agoKill unused ROUTE6D_CONF define.
jca [Sun, 25 Oct 2015 22:45:21 +0000 (22:45 +0000)]
Kill unused ROUTE6D_CONF define.

Since 1999 no one has found the need to write support for a config file.

9 years agoAnother pidfile(3) removal; ok benno@
jca [Sun, 25 Oct 2015 22:38:48 +0000 (22:38 +0000)]
Another pidfile(3) removal; ok benno@

9 years agoIn case of error, also log the file name we failed to open.
jca [Sun, 25 Oct 2015 22:36:17 +0000 (22:36 +0000)]
In case of error, also log the file name we failed to open.

9 years agoExtend the modifiers allowed before formats: as well as the existing
nicm [Sun, 25 Oct 2015 22:29:17 +0000 (22:29 +0000)]
Extend the modifiers allowed before formats: as well as the existing
#{=10:...}  length limit, add #{t:...} to convert a time_t format to a
string, #{b:...} for basename and #{d:...} for dirname. Remove all the
foo_string time formats as they can now be replaced by "t:", for example
#{window_activity_string} becomes #{t:window_activity}.

9 years agounifdef some oldness. (BSD not defined since removal of param.h)
tedu [Sun, 25 Oct 2015 22:13:39 +0000 (22:13 +0000)]
unifdef some oldness. (BSD not defined since removal of param.h)
ok jca sthen

9 years agoansify
jca [Sun, 25 Oct 2015 22:11:34 +0000 (22:11 +0000)]
ansify

9 years agounbreak tree for ramdisks without INET6
deraadt [Sun, 25 Oct 2015 21:58:04 +0000 (21:58 +0000)]
unbreak tree for ramdisks without INET6

9 years agoUnify & improve paragraphs talking about "==> file <==" headers in
zhuk [Sun, 25 Oct 2015 21:50:32 +0000 (21:50 +0000)]
Unify & improve paragraphs talking about "==> file <==" headers in
head(1) and tail(1).

Input & okay from jmc@

9 years agoRemove PIDDIR and PIDFILE missed in previous commit.
millert [Sun, 25 Oct 2015 21:36:55 +0000 (21:36 +0000)]
Remove PIDDIR and PIDFILE missed in previous commit.

9 years agosync
deraadt [Sun, 25 Oct 2015 21:36:36 +0000 (21:36 +0000)]
sync

9 years agoPut some comments in how nd6_rs_attach() works.
florian [Sun, 25 Oct 2015 21:32:16 +0000 (21:32 +0000)]
Put some comments in how nd6_rs_attach() works.
Requested by stsp

9 years agopledge "stdio inet route"; ok deraadt@
jca [Sun, 25 Oct 2015 21:31:58 +0000 (21:31 +0000)]
pledge "stdio inet route"; ok deraadt@

9 years agoRemove cron.pid support. We still want to avoid multiple crons
millert [Sun, 25 Oct 2015 21:30:11 +0000 (21:30 +0000)]
Remove cron.pid support.  We still want to avoid multiple crons
running so verify that if the cron socket exists nothing is listening
on it.  OK tedu@

9 years agoStop writing down a pidfile.
jca [Sun, 25 Oct 2015 21:23:42 +0000 (21:23 +0000)]
Stop writing down a pidfile.

pid files aren't useful on OpenBSD, the rc.d(8) framework doesn't use
them.  In rtadvd, not writing a pid file means that we can set tighter
pledge(2) settings.  Also the pid file handling is pretty basic and the
atexit handler can't remove the pid file since rtadvd did a chroot - beurk.

ok florian@, "perfect" deraadt@ (!)

9 years agoFix installboot(8) on i386/amd64 when softraid is on top of GPT.
stsp [Sun, 25 Oct 2015 21:21:15 +0000 (21:21 +0000)]
Fix installboot(8) on i386/amd64 when softraid is on top of GPT.
ok krw deraadt

9 years agoFold "malloc" into "stdio" and -- recognizing that no program so far has
deraadt [Sun, 25 Oct 2015 20:39:54 +0000 (20:39 +0000)]
Fold "malloc" into "stdio" and -- recognizing that no program so far has
used less than "stdio" -- include all the "self" operations.  Instead of
different defines, use regular PLEDGE_* in the "p_pledgenote" variable
(which indicates the operation subtype a system call is performing).  Many
checks before easier to understand.  p_pledgenote can often be passed
directly to ktrace, so that kdump says:
 15565 test     CALL  pledge(0xa9a3f804c51,0)
 15565 test     STRU  pledge request="stdio"
 15565 test     RET   pledge 0
 15565 test     CALL  open(0xa9a3f804c57,0x2<O_RDWR>)
 15565 test     NAMI  "/tmp/testfile"
 15565 test     PLDG  open, "wpath", errno 1 Operation not permitted
with help from semarie, ok guenther

9 years agopledge "route" no longer needed for if_indextoname & if_nametoindex
deraadt [Sun, 25 Oct 2015 20:23:00 +0000 (20:23 +0000)]
pledge "route" no longer needed for if_indextoname & if_nametoindex

9 years agoWrite error message instead of duplicated file name on error.
tobias [Sun, 25 Oct 2015 20:18:37 +0000 (20:18 +0000)]
Write error message instead of duplicated file name on error.

ok deraadt

9 years agoChange test to use length 128 (shortest long-form encoding).
doug [Sun, 25 Oct 2015 20:15:06 +0000 (20:15 +0000)]
Change test to use length 128 (shortest long-form encoding).

From BoringSSL commit: d13a5e15d4e4eb51513be665306a2beba39869df

9 years agopr_bitrange() is unused, nuke it.
florian [Sun, 25 Oct 2015 20:01:21 +0000 (20:01 +0000)]
pr_bitrange() is unused, nuke it.

9 years agoremove prototype for removed pingerlen function.
florian [Sun, 25 Oct 2015 19:58:56 +0000 (19:58 +0000)]
remove prototype for removed pingerlen function.

9 years agoenable asmc(4) on i386
jung [Sun, 25 Oct 2015 19:32:33 +0000 (19:32 +0000)]
enable asmc(4) on i386

9 years agorefactor to use a taskq and postpone the long running initial sensor probing,
jung [Sun, 25 Oct 2015 19:26:43 +0000 (19:26 +0000)]
refactor to use a taskq and postpone the long running initial sensor probing,
also avoid excessive tsleep()s for updates within the sensor task,
moreover this should fix some seldom seen 'comm collision' errors

9 years agoWrap waitpid() so calls go direct; weaken wait() and wait3().
guenther [Sun, 25 Oct 2015 19:15:56 +0000 (19:15 +0000)]
Wrap waitpid() so calls go direct; weaken wait() and wait3().
Strip out unnecessary #includes and use NULL instead of (struct rusage *)0

9 years agoRename imsg_compose_parent and imsg_compose_rde to imsg_ctl_parent and
claudio [Sun, 25 Oct 2015 18:49:01 +0000 (18:49 +0000)]
Rename imsg_compose_parent and imsg_compose_rde to imsg_ctl_parent and
imsg_ctl_rde since these function should only be used by the control
code. Also switch ibuf_rde to ibuf_rde_ctl so that the control imsgs
don't need to queue behind all the incoming bgp UPDATES. This speeds
up 'bgpctl show' from taking minutes to a few seconds. The RDE was doing
this since a very long time but it seems the SE was not adjusted. Yikes

9 years agoOnly run the rib_dump_runner() if there is something pending and the
claudio [Sun, 25 Oct 2015 18:45:04 +0000 (18:45 +0000)]
Only run the rib_dump_runner() if there is something pending and the
control socket has not many messages queued.

9 years agoCast ctype functions' argument to unsigned char.
mmcc [Sun, 25 Oct 2015 18:25:41 +0000 (18:25 +0000)]
Cast ctype functions' argument to unsigned char.

ok guenther@

9 years agoMove the _atfork_list definition to atexit.c so that the fork syscall stub
guenther [Sun, 25 Oct 2015 18:03:17 +0000 (18:03 +0000)]
Move the _atfork_list definition to atexit.c so that the fork syscall stub
doesn't get pulled into all static executables

ok millert@ jca@

9 years agoHide __atexit and __atexit_register_cleanup()
guenther [Sun, 25 Oct 2015 18:01:24 +0000 (18:01 +0000)]
Hide __atexit and __atexit_register_cleanup()
Wrap __cxa_{atexit,finalize}() so the call from exit() goes direct
Switch regress/lib/libc/atexit/ to be built with -static so that it can
  still access __atexit*

ok millert@ jca@

9 years agopledge_sockopt_check is shared between setsockopt/getsockopt. nicm
deraadt [Sun, 25 Oct 2015 17:45:29 +0000 (17:45 +0000)]
pledge_sockopt_check is shared between setsockopt/getsockopt.  nicm
found the first case of "get allowed, set not allowed".  Tiny
refactoring of that.

9 years ago'b0' and 'b1' are no longer supported, so de-document them.
krw [Sun, 25 Oct 2015 16:45:08 +0000 (16:45 +0000)]
'b0' and 'b1' are no longer supported, so de-document them.

9 years agoNuke union of d_packname with un_d_boot0 & un_d_boot1, keeping
krw [Sun, 25 Oct 2015 16:35:40 +0000 (16:35 +0000)]
Nuke union of d_packname with un_d_boot0 & un_d_boot1, keeping
d_packname as a simple field. Also nuke the access #defines, and
support for b0 and b1 capabilities in disktab.

ok deraadt@ miod@

9 years agoI should not have committed this chunk. Spotted by krw@
mpi [Sun, 25 Oct 2015 16:25:23 +0000 (16:25 +0000)]
I should not have committed this chunk.  Spotted by krw@

9 years agoSort the obsolete flags.
doug [Sun, 25 Oct 2015 16:07:04 +0000 (16:07 +0000)]
Sort the obsolete flags.

9 years agoMark SSL_OP_NO_{COMPRESSION,SSLv2,SSLv3} as obsolete.
doug [Sun, 25 Oct 2015 15:58:57 +0000 (15:58 +0000)]
Mark SSL_OP_NO_{COMPRESSION,SSLv2,SSLv3} as obsolete.

For backward compatibility, the flags are redefined as 0.

ok jsing@

9 years agoRemove last vestige of SSL_OP_NO_SSLv3 support.
doug [Sun, 25 Oct 2015 15:52:49 +0000 (15:52 +0000)]
Remove last vestige of SSL_OP_NO_SSLv3 support.

No part of LibreSSL checks for this flag any longer.

ok jsing@

9 years agoSimplify ssl23_get_client_hello error handling.
doug [Sun, 25 Oct 2015 15:49:04 +0000 (15:49 +0000)]
Simplify ssl23_get_client_hello error handling.

ssl23_get_client_hello sets type=1 on error and continues processing.
It should return an error immediately to simplify things.  This also
allows us to start removing the last of SSL_OP_NO_SSL*.

Added extra paranoia for s->version to make sure it is set properly.

ok jsing@

9 years agoDecapitalize yyparse tag name here.
zhuk [Sun, 25 Oct 2015 15:38:19 +0000 (15:38 +0000)]
Decapitalize yyparse tag name here.

okay jmc@

9 years agostrvis directory names in ps
czarkoff [Sun, 25 Oct 2015 15:26:53 +0000 (15:26 +0000)]
strvis directory names in ps

OK stsp@

9 years agoSimple sizes for free(9).
mpi [Sun, 25 Oct 2015 15:24:03 +0000 (15:24 +0000)]
Simple sizes for free(9).

ok claudio@

9 years agodo not expose nd6 randomid's to userland via ioctl.
deraadt [Sun, 25 Oct 2015 15:11:52 +0000 (15:11 +0000)]
do not expose nd6 randomid's to userland via ioctl.
ok claudio mpi florian

9 years agoTrivial rt_ifp->if_index -> rt_ifidx conversions.
mpi [Sun, 25 Oct 2015 15:01:59 +0000 (15:01 +0000)]
Trivial rt_ifp->if_index -> rt_ifidx conversions.

9 years agoSync after recent rtable_insert() change.
mpi [Sun, 25 Oct 2015 14:56:14 +0000 (14:56 +0000)]
Sync after recent rtable_insert() change.

9 years agoMerge rtable_mpath_conflict() into rtable_insert().
mpi [Sun, 25 Oct 2015 14:48:51 +0000 (14:48 +0000)]
Merge rtable_mpath_conflict() into rtable_insert().

ok claudio@

9 years agoIPV6_NEXTHOP is gone, remove -g option which used this.
florian [Sun, 25 Oct 2015 14:43:48 +0000 (14:43 +0000)]
IPV6_NEXTHOP is gone, remove -g option which used this.
kill it mpi@

9 years agoRemove IPV6_NEXTHOP implementation. Source routing is considered to be
florian [Sun, 25 Oct 2015 14:43:06 +0000 (14:43 +0000)]
Remove IPV6_NEXTHOP implementation. Source routing is considered to be
a bad idea these days.
kill it mpi@
general agreement in the network hackers room at u2k15

9 years agoKill unused local var, and reorder while here.
jca [Sun, 25 Oct 2015 14:42:02 +0000 (14:42 +0000)]
Kill unused local var, and reorder while here.

9 years agoBe more consisten with rtmsgs. Always set rtm_index (even in the RTM_GET
claudio [Sun, 25 Oct 2015 14:41:09 +0000 (14:41 +0000)]
Be more consisten with rtmsgs. Always set rtm_index (even in the RTM_GET
case) and always set rtm_pid to the pid of the requestor (even in the
sysctl code path).
OK mpi@

9 years agoWe don't care about lack of source route support for IPv6.
jca [Sun, 25 Oct 2015 14:12:55 +0000 (14:12 +0000)]
We don't care about lack of source route support for IPv6.

ok sthen@ guenther@ mpi@ millert@

9 years agoKill IP Source Route support, unusable since 1998.
jca [Sun, 25 Oct 2015 14:11:37 +0000 (14:11 +0000)]
Kill IP Source Route support, unusable since 1998.

ok sthen@ guenther@ mpi@ millert@

9 years agoUse the "modern" way to check if a route entry correspond to a local
mpi [Sun, 25 Oct 2015 13:55:51 +0000 (13:55 +0000)]
Use the "modern" way to check if a route entry correspond to a local
address.

Fix a regression introduced when removing the lo0 hack.

ok florian@

9 years agoDo not overwrite if_rtrequest() if the driver specified it *before*
mpi [Sun, 25 Oct 2015 13:52:45 +0000 (13:52 +0000)]
Do not overwrite if_rtrequest() if the driver specified it *before*
calling if_attach().

9 years agoarp_ifinit() is no longer needed.
mpi [Sun, 25 Oct 2015 13:22:09 +0000 (13:22 +0000)]
arp_ifinit() is no longer needed.

9 years agoarp_ifinit() is no longer needed and almost dead.
mpi [Sun, 25 Oct 2015 13:13:06 +0000 (13:13 +0000)]
arp_ifinit() is no longer needed and almost dead.

9 years agozap trailing whitespace;
jmc [Sun, 25 Oct 2015 13:08:29 +0000 (13:08 +0000)]
zap trailing whitespace;

9 years agotweak previous;
jmc [Sun, 25 Oct 2015 13:05:56 +0000 (13:05 +0000)]
tweak previous;

9 years agoarp_ifinit() is no longer needed.
mpi [Sun, 25 Oct 2015 13:04:28 +0000 (13:04 +0000)]
arp_ifinit() is no longer needed.

9 years agoifa is no longer used.
mpi [Sun, 25 Oct 2015 12:59:57 +0000 (12:59 +0000)]
ifa is no longer used.

9 years agoarp_ifinit() is no longer needed.
mpi [Sun, 25 Oct 2015 12:48:46 +0000 (12:48 +0000)]
arp_ifinit() is no longer needed.

9 years agoImplement ping(8)'s -L option in ping6:
florian [Sun, 25 Oct 2015 12:47:26 +0000 (12:47 +0000)]
Implement ping(8)'s -L option in ping6:
Disable the loopback, so the transmitting host doesn't see the ICMP
requests. For multicast pings.
OK benno@

9 years agoarp_ifinit() is no longer needed.
mpi [Sun, 25 Oct 2015 12:11:56 +0000 (12:11 +0000)]
arp_ifinit() is no longer needed.

9 years agoarp_ifinit() is no longer required.
mpi [Sun, 25 Oct 2015 12:05:40 +0000 (12:05 +0000)]
arp_ifinit() is no longer required.

9 years agoMissing initializer; spotted by coverity.
miod [Sun, 25 Oct 2015 11:59:37 +0000 (11:59 +0000)]
Missing initializer; spotted by coverity.

9 years agoIntroduce if_rtrequest() the successor of ifa_rtrequest().
mpi [Sun, 25 Oct 2015 11:58:11 +0000 (11:58 +0000)]
Introduce if_rtrequest() the successor of ifa_rtrequest().

L2 resolution depends on the protocol (encoded in the route entry) and
an ``ifp''.  Not having to care about an ``ifa'' makes our life easier
in our MP effort.  Fewer dependencies between data structures implies
fewer headaches.

Discussed with bluhm@, ok claudio@

9 years agobackout; many issues remain...
deraadt [Sun, 25 Oct 2015 11:44:30 +0000 (11:44 +0000)]
backout; many issues remain...

9 years agoreorder some checks in pledge_namei() in order to properly work.
semarie [Sun, 25 Oct 2015 11:09:28 +0000 (11:09 +0000)]
reorder some checks in pledge_namei() in order to properly work.

mainly move read/write whitelisted paths that should be *before* checking if
you have PLEDGE_WPATH.

with and ok deraadt@

9 years agothe DNS process was not discarding & redirecting stdin/out/err to
deraadt [Sun, 25 Oct 2015 10:52:48 +0000 (10:52 +0000)]
the DNS process was not discarding & redirecting stdin/out/err to
/dev/null.  copy the code from the ntp engine.

9 years agops(1) needs sysctl KERN_PROC_CWD exposed as well in the pledge "ps" set.
deraadt [Sun, 25 Oct 2015 10:30:58 +0000 (10:30 +0000)]
ps(1) needs sysctl KERN_PROC_CWD exposed as well in the pledge "ps" set.
hit by czarkoff

9 years agoThe only thing that was translated into multiple languages in OpenBSD
bluhm [Sun, 25 Oct 2015 10:22:09 +0000 (10:22 +0000)]
The only thing that was translated into multiple languages in OpenBSD
are the errno messages and signal names.  Everything else is in
English.  We are not planning to translate more text.  Running a
mixed system with less than 1% of the text in native language makes
no sense.  So remove the NLS support from libc messages.  The
catopen(3) functions stay as they are.
OK stsp@ mpi@

9 years agoUse 'fdisk -i', instead of 'fdisk -e' with a here document of
krw [Sun, 25 Oct 2015 10:20:51 +0000 (10:20 +0000)]
Use 'fdisk -i', instead of 'fdisk -e' with a here document of
'reinit;update;write;quit'. They've done the same thing for some
time now.

Tweaks & test from rpe@.

ok rpe@ deraadt@

9 years agoInstead of doing the the if_get() dance for rt_missmsg(), change the
bluhm [Sun, 25 Oct 2015 10:05:09 +0000 (10:05 +0000)]
Instead of doing the the if_get() dance for rt_missmsg(), change the
function to take an interface index.
discussed with mpi@;  OK claudio@

9 years agosync
miod [Sun, 25 Oct 2015 09:59:08 +0000 (09:59 +0000)]
sync

9 years agoneed "getpw" pledge; spotted by matthieu
deraadt [Sun, 25 Oct 2015 09:39:00 +0000 (09:39 +0000)]
need "getpw" pledge; spotted by matthieu

9 years agoroute flush cannot pledge before sysctl for NET_RT_DUMP; defer the act.
deraadt [Sun, 25 Oct 2015 09:37:08 +0000 (09:37 +0000)]
route flush cannot pledge before sysctl for NET_RT_DUMP; defer the act.
issue spotted by matthieu

9 years agojust dump the help on stdout with messing about with a pager.
tedu [Sun, 25 Oct 2015 09:34:49 +0000 (09:34 +0000)]
just dump the help on stdout with messing about with a pager.
makes pledge much simpler.
from jan stary

9 years agoPass output from jobs through format_expand() so they are expanded again
nicm [Sun, 25 Oct 2015 08:59:26 +0000 (08:59 +0000)]
Pass output from jobs through format_expand() so they are expanded again
(this was the previous behaviour).

9 years agoNo need to declare pwd_gensalt; it's unused and gone.
ajacoutot [Sun, 25 Oct 2015 08:39:26 +0000 (08:39 +0000)]
No need to declare pwd_gensalt; it's unused and gone.
ok tedu@

9 years agopledge the main usage patterns similar to arp(8). Some akkorokamui
deraadt [Sun, 25 Oct 2015 08:07:31 +0000 (08:07 +0000)]
pledge the main usage patterns similar to arp(8).  Some akkorokamui
prevent doing this better, someone should try to refactor this more
like arp... also figure out what dawn-of-ipv6 options can be removed.
ok benno

9 years agoLet's see if anyone screams about not being able to specify $TMPDIR
deraadt [Sun, 25 Oct 2015 07:48:16 +0000 (07:48 +0000)]
Let's see if anyone screams about not being able to specify $TMPDIR
for their tmux sockets.

(Over the years, I have seen $TMPDIR set up worse than /tmp many times,
and don't know how this practice infected other parts of the system.
Nothing uses tmpdir(3), nor a huge-temporary-file program like sort.)
ok nicm

9 years agopledge bind(1), dig(1), and nslookup(1). This modifies the underlying
deraadt [Sun, 25 Oct 2015 07:44:42 +0000 (07:44 +0000)]
pledge bind(1), dig(1), and nslookup(1).  This modifies the underlying
ISC library to use socket(2) with the SOCK_DNS flag.  As a result, the
port commands are disabled (such practice is rare in the wild these days,
and pretty incompatible with the DNS vs regular socket concept in pledge..)
ok bluhm phessler reyk, etc

9 years agoUse sigaction() instead of signal() to avoid pulling in unnecessary
guenther [Sun, 25 Oct 2015 04:13:59 +0000 (04:13 +0000)]
Use sigaction() instead of signal() to avoid pulling in unnecessary
wrappers.  To keep uses from crawling back in, mark signal() as
deprecated inside libc.

ok deraadt@

9 years agoUse dprintf() instead of fprintf() in the signal handler
guenther [Sun, 25 Oct 2015 04:11:00 +0000 (04:11 +0000)]
Use dprintf() instead of fprintf() in the signal handler

9 years agoPOSIX says that you can't capture the return value of sigsetjmp().
guenther [Sun, 25 Oct 2015 03:40:58 +0000 (03:40 +0000)]
POSIX says that you can't capture the return value of sigsetjmp().
Fortunately, we don't need it as we only pass siglongjmp() a single value.

ok deraadt@

9 years agoFor SYS_open let the /dev/null special case match if any TMN_RPATH,
millert [Sun, 25 Oct 2015 01:57:09 +0000 (01:57 +0000)]
For SYS_open let the /dev/null special case match if any TMN_RPATH,
TMN_WPATH or both are set in p_pledgenote.  Matches the style used
for /dev/tty special cases (among others).  From deraadt@

9 years agoFix some bugs in the detection of when an interface can be enabled.
renato [Sun, 25 Oct 2015 00:43:35 +0000 (00:43 +0000)]
Fix some bugs in the detection of when an interface can be enabled.

9 years agoWhen converting the real bandwidth to the composite bandwidth, truncate
renato [Sun, 25 Oct 2015 00:42:02 +0000 (00:42 +0000)]
When converting the real bandwidth to the composite bandwidth, truncate
before applying the scaling factor.

When converting the composite bandwidth to the real bandwidth, apply
the scaling factor before the division and only then truncate.

This is to keep consistent with what Cisco does, the draft is unclear
on this point.

9 years agoAdd a few more overflow protections in the DUAL state
renato [Sun, 25 Oct 2015 00:39:14 +0000 (00:39 +0000)]
Add a few more overflow protections in the DUAL state
machine.