7085 Commits

Author SHA1 Message Date
David van Moolenbroek
686761dbbc syslogd(8): drop some MINIX-specific changes
Change-Id: Ic286b89975eeea1abf0d5086ee13dfb9ab57d8ba
2017-03-21 22:00:37 +00:00
David van Moolenbroek
5bded7c030 ftpd(8): drop some MINIX-specific changes
Also put in a crude way to clean up zombies when ftpd(8) is running
in daemon mode, because we do not yet support SA_NOCLDWAIT.

Change-Id: I8a7db1d665c432d736db833b0022d0340764db1f
2017-03-21 22:00:34 +00:00
David van Moolenbroek
340f5e5660 Import NetBSD httpd(8)
Also known as bozohttpd(8).

Change-Id: I40e955b5654674f2c708b10e5e403ca9cbc92534
2017-03-21 22:00:31 +00:00
David van Moolenbroek
8f957290eb Import NetBSD rtadvd(8)
Change-Id: I22626843d85c78f0fadefd58d61d7a85d285b2b8
2017-03-21 22:00:28 +00:00
David van Moolenbroek
5de448e315 Import NetBSD ndp(8)
Like arp(8), this utility already uses the NetBSD 8 protocol for
talking to the operating system through routing sockets.

Like arp(8), this utility is not fully functional, due to limitations
of lwIP.  While ndp(8) should provide a proper (read-only) view of the
contents of the Neighbor Discovery table, any attempts to modify the
table will fail.  In addition, various other ndp(8) features are not
supported.  On MINIX 3, the prefix and default router lists are not
managed by the operating system however, but rather by dhcpcd(8);
therefore, an implementation of the features related to those lists
would not provide any actual functionality.

Change-Id: I479bfc8141ba69fe50c1b2f7091933267ce6fa3e
2017-03-21 22:00:25 +00:00
David van Moolenbroek
b636d99d91 Import NetBSD tcpdump(8)
For now, printing of Sun RPC requests is disabled because we do not
yet have the RPC header files.  This should affect basically noone,
as we do not have any RPC-based programs yet, for the same reason.

Change-Id: Ie7818faaaacdc104d8b2c37a68866b4ce18247d6
2017-03-21 22:00:21 +00:00
David van Moolenbroek
d56f51ea7d Import NetBSD libpcap
As part of this, we import bpf_filter.c from NetBSD.  Even though that
file is part of the NetBSD kernel, it is also used by userland (as is
clear here).  Our LWIP service has its own bpf_filter.c implementation
but that implementation has certain limits (e.g. on program size) that
are fine for a system service but should not apply to userland.

The libpcap code has a number of blocks guarded by __NetBSD__, but
none of those blocks apply to MINIX 3.  In particular, some of the
alignment logic used for NetBSD may in fact not work in our case.

Change-Id: Ib187e22d627c929e111d5d4a991c3bee3c0154cb
2017-03-21 22:00:18 +00:00
David van Moolenbroek
83ee113ee0 Import NetBSD dhclient(8), dhcpd(8), dhcrelay(8)
dhcrelay(8) and omshell(1) have not been tested.

Change-Id: I0cad89f65666af4e366a86e130ce8df0894c3bb4
2017-03-21 22:00:14 +00:00
David van Moolenbroek
00b67f09dd Import NetBSD named(8)
Also known as ISC bind.  This import adds utilities such as host(1),
dig(1), and nslookup(1), as well as many other tools and libraries.

Change-Id: I035ca46e64f1965d57019e773f4ff0ef035e4aa3
2017-03-21 22:00:06 +00:00
David van Moolenbroek
9f20bfa6c4 Import NetBSD dhcpcd(8)
The port could be improved by adding support for pselect(2).

Other than that, this port has a few MINIX-specific changes:

- we undefine IN_IFF_ flags to stop dhcpcd from thinking that we have
  operating system support for link-local IPv4 address management;
- we work around one crash bug that seems triggered by using dhcpcd
  on some but not all interfaces;
- we add "noalias" to the default dhcpcd.conf(5) configuration file.

Change-Id: I8a81c2c2af353c5ce08335673b1ab2d4b39178da
2017-03-21 21:59:13 +00:00
David van Moolenbroek
d642636d2d Import NetBSD resolvconf(8)
Also known as "openresolv".  Needed for dhcpcd(8).

Change-Id: Ibcb616837e9a5293377e451c6f6218a37260ed80
2017-03-09 23:40:18 +00:00
David van Moolenbroek
c3b6f8f269 Import NetBSD inetd(8)
Do not start it by default just yet.

Change-Id: Id8d2dd33eb67ae74b3ef3060638e20c781e8e37d
2017-03-09 23:40:18 +00:00
David van Moolenbroek
e044bafaad Import NetBSD telnetd(8)
Change-Id: Ie1ae80e8a4945f6f4ccce8f468c1b04a8d89cf43
2017-03-09 23:40:17 +00:00
David van Moolenbroek
7348b5c52b Import NetBSD telnet(1)
Change-Id: Ib58b43cc9baabe183a59410212827f65ec117277
2017-03-09 23:40:16 +00:00
David van Moolenbroek
72e899eafc Import NetBSD traceroute6(8)
Change-Id: I040651cf29a9efd6b85afafe6813e48c2f1a4f2d
2017-03-09 23:40:16 +00:00
David van Moolenbroek
903ca1e525 Import NetBSD ping6(8)
Change-Id: Ife49f5fac0e50852c74a0f85b6129c204d172c68
2017-03-09 23:40:15 +00:00
David van Moolenbroek
04e82b7dc9 Import NetBSD arp(8)
Behaviorally this port should already be largely on par with the
NetBSD 8 version, in that it sets the RTF_LLDATA flag on routing
socket requests to indicate that they target link-local data.

Many parts of the arp(8) functionality are currently not yet supported
by the operating system, largely due to lwIP not exposing appropriate
means of implementing them.

Change-Id: Icfac054b4deddda03eee4acf0e261aa48cd031ba
2017-03-09 23:40:14 +00:00
David van Moolenbroek
66dfcc8533 Import NetBSD netstat(1)
The port forces the use of sysctl(7), as obtaining information through
KVM is not and will never be viable.  The sysctl mode of netstat(1) is
currently somewhat limited and buggy, though.  We fix a few minimal
issues, but more improvements will have to come from NetBSD reimports.

Some of netstat(1)'s views are currently not supported by the
operating system.  Later improvements on this point will not require
changes to the imported code, though.

Change-Id: If74a6811f0fc81bd1ecc31010a28379b14b2a0eb
2017-03-09 23:40:14 +00:00
David van Moolenbroek
483e595557 Import NetBSD route(8)
Change-Id: I724a2a56157ea72afdd3f6a82239687894c8e3e8
2017-03-09 23:40:13 +00:00
David van Moolenbroek
90b801219a Import NetBSD ifconfig(8)
Not all of its functionality is actually implemented in the operating
system.  In addition, a few modules (agr, vlan) have been disabled
because we have not imported the necessary headers yet.

Change-Id: I4c9271065d640bd9112b4bd27e2652e1d51b18b4
2017-03-09 23:40:12 +00:00
David van Moolenbroek
f1fab66e7d Import NetBSD libwrap
Change-Id: Ib8b979fb9a96c2048b8ea93038944c743048bff4
2017-03-09 23:40:12 +00:00
David van Moolenbroek
c2a43b2200 Import NetBSD nsswitch.conf(5)
Change-Id: I0464b474d50b39cd6259c492e1fae6fecfd9d984
2017-03-09 23:40:11 +00:00
David van Moolenbroek
9b6c0eaf74 Import NetBSD hosts(5)
Change-Id: I0924dcc7d4eb9151b77305f370360722d4a7533a
2017-03-09 23:40:11 +00:00
David van Moolenbroek
5588c638c0 libutil: drop some MINIX-specific changes
Change-Id: I8deeac84deb4a986b62caabe96c8f7c722d97921
2017-03-09 23:40:10 +00:00
David van Moolenbroek
722c5aa73f Enable IPv6 support
Change-Id: I3f68c38ca5efbecd04941064542ed24004db1429
2017-03-09 23:40:09 +00:00
David van Moolenbroek
08cbf5a04d Enable a few more NetBSD functions
Change-Id: Ia8463adfb12b465bd43a62aee9f14b21eaa13b19
2017-03-09 23:40:09 +00:00
David van Moolenbroek
e6dabba58b PTY: add minimal support for TIOCPKT
With TIOCPKT enabled, each piece of output is preceded by a zero byte
on the PTY master.  In addition, a non-zero byte is a flags field
that conveys information about changes on the pseudoterminal.  This
patch implements the former, but not the latter.  That is enough to
get telnetd(8) going, however.  TIOCPKT support may be extended later.

Change-Id: I6ef9cc8cf1b4406147b088400fc8499684b62a30
2017-03-09 23:40:08 +00:00
David van Moolenbroek
d7c7182ad4 Retire MINIX rlogin(1)
Change-Id: Ib85e74e5333e8fffa05631dbc760284761bf3ecb
2017-03-09 23:40:08 +00:00
David van Moolenbroek
47ebcd22bd Retire MINIX rget(1), rput(1)
Change-Id: I70e3ec9281275730c589fb7683801dc1ca584cab
2017-03-09 23:40:07 +00:00
David van Moolenbroek
a9ef5b90e6 Retire MINIX in.telnetd(8)
Change-Id: Ib54998e7a81f924d19b8013ef567703996d24a03
2017-03-09 23:40:06 +00:00
David van Moolenbroek
4d04ccc15b Retire MINIX telnet(1)
..which, for some strange reason, was installed as "ttn".

Change-Id: I5ad2f969ad7978a27fb7345f8434470ca427d429
2017-03-09 23:40:06 +00:00
David van Moolenbroek
34a8cf369f Retire MINIX rarpd(8)
Change-Id: I2d7b7edbb8fa6000ba368d156cf947e7691cf454
2017-03-09 23:40:05 +00:00
David van Moolenbroek
9cf227216d Retire MINIX irdpd(8)
Change-Id: Id11c6db9db5da18346d993cb9c3faa4313ed3ed4
2017-03-09 23:40:04 +00:00
David van Moolenbroek
f130137a5e Retire MINIX arp(8)
Change-Id: I8351fbb99d73811282e46dae7fae1b6abb130bf2
2017-03-09 23:40:04 +00:00
David van Moolenbroek
b8046fb69b Retire MINIX tcpd(8)
Change-Id: If419d441c5df0b9f2e29db1ef0d904d102739f9b
2017-03-09 23:40:03 +00:00
David van Moolenbroek
fd8826c892 Retire MINIX host(1)
Change-Id: I19d2e866d6d397d3bff9ba698cb8ec26267ee82c
2017-03-09 23:40:03 +00:00
David van Moolenbroek
9490732a59 Retire MINIX dhcpd(8)
Change-Id: I4b8c738b6176ce390a7a7817b0dcaf9caffe636c
2017-03-09 23:40:02 +00:00
David van Moolenbroek
035c234ade Retire MINIX hostaddr(1)
Change-Id: I30c7b5fe4c96ea040c3eea46f1dc4d9bd135745d
2017-03-09 23:40:01 +00:00
David van Moolenbroek
407c396431 Retire MINIX nonamed(8)
Also retire support for the MINIX versions of /etc/hosts and
/etc/resolv.conf.  These files will be brought back with NetBSD
imports, although like NetBSD, MINIX 3 will be using external
resolvers directly from then on.  Since resolv.conf is hand-created
rather than installed, we do not mark it as obsolete.

Change-Id: Ie6154d5a4d8d977c19b9754bf920ae868680e9d1
2017-03-09 23:40:01 +00:00
David van Moolenbroek
50c98e1f41 Retire MINIX pr_routes(8)
Change-Id: Ic7494d097f9d19185b7173edb7590044baee5abc
2017-03-09 23:40:00 +00:00
David van Moolenbroek
73ee574be3 Retire MINIX add_route(8)
Change-Id: I900a3c6ac8e8fac15f5f84960bb89f92aeb90863
2017-03-09 23:40:00 +00:00
David van Moolenbroek
96339c07fd Retire MINIX ifconfig(8)
Change-Id: I26f3ceff01bbd31e4c009752c7454a58e8a72abf
2017-03-09 23:39:59 +00:00
David van Moolenbroek
c5da0dffe2 Retire inet: the previous MINIX TCP/IP service
This commit (temporarily) leaves MINIX 3 without a TCP/IP service.

Thanks go out to Philip Homburg for providing this TCP/IP stack in the
first place.  It has served MINIX well for a long time.

Change-Id: I0e3eb6fe64204081e4e3c2b9d6e6bd642f121973
2017-03-09 23:39:58 +00:00
David van Moolenbroek
3ea34559da Retire lwip: the previous lwIP-based TCP/IP service
Change-Id: Id9bbf96344a6e9d796f6773547588a981e70bf0f
2017-03-09 23:39:58 +00:00
David van Moolenbroek
49bf8d5c6a Retire MINIX tcpstat(1), udpstat(1)
This needs to be done before retiring inet itself, since these
utilities include headers from inet directly.

Also retire the now-obsolete paramvalue(3).

Change-Id: I9b27771190a6a32ee533b0c0d9d37f61a16ee36c
2017-03-09 23:39:57 +00:00
David van Moolenbroek
baa5830f28 tests: add advanced UDS tests (test90)
Change-Id: Ib4b81d441368fd9b7e7c7b9cab802bb01fa04065
2017-03-09 23:39:56 +00:00
David van Moolenbroek
27852ebe53 UDS: full rewrite
This new implementation of the UDS service is built on top of the
libsockevent library.  It thereby inherits all the advantages that
libsockevent brings.  However, the fundamental restructuring
required for that change also paved the way for resolution of a
number of other important open issues with the old UDS code.  Most
importantly, the rewrite brings the behavior of the service much
closer to POSIX compliance and NetBSD compatibility.  These are the
most important changes:

- due to the use of libsockevent, UDS now supports multiple suspending
  calls per socket and a large number of standard socket flags and
  options;
- socket address matching is now based on <device,inode> lookups
  instead of canonized path names, and socket addresses are no longer
  altered either due to canonization or at connect time;
- the socket state machine is now well defined, most importantly
  resolving the erroneous reset-on-EOF semantics of the old UDS, but
  also allowing socket reuse;
- sockets are now connected before being accepted instead of being
  held in connecting state, unless the LOCAL_CONNWAIT option is set
  on either the connecting or the listening socket;
- connect(2) on datagram sockets is now supported (needed by syslog),
  and proper datagram socket disconnect notification is provided;
- the receive queue now supports segmentation, associating ancillary
  data (in-flight file descriptors and credentials) with each segment
  instead of being kept fully separately; this is a POSIX requirement
  (and needed by tmux);
- as part of the segmentation support, the receive queue can now hold
  as many packets as can fit, instead of one;
- in addition to the flags supported by libsockevent, the MSG_PEEK,
  MSG_WAITALL, MSG_CMSG_CLOEXEC, MSG_TRUNC, and MSG_CTRUNC send and
  receive flags are now supported;
- the SO_PASSCRED and SO_PEERCRED socket options are replaced by
  LOCAL_CREDS and LOCAL_PEEREID respectively, now following NetBSD
  semantics and allowing use of NetBSD libc's getpeereid(3);
- memory usage is reduced by about 250 KB due to centralized in-flight
  file descriptor tracking, with a limit of OPEN_MAX total rather than
  of OPEN_MAX per socket;
- memory usage is reduced by another ~50 KB due to removal of state
  redundancy, despite the fact that socket path names may now be up to
  253 bytes rather than the previous 104 bytes;
- compared to the old UDS, there is now very little direct indexing on
  the static array of sockets, thus allowing dynamic allocation of
  sockets more easily in the future;
- the UDS service now has RMIB support for the net.local sysctl tree,
  implementing preliminary support for NetBSD netstat(1).

Change-Id: I4a9b6fe4aaeef0edf2547eee894e6c14403fcb32
2017-03-09 23:39:56 +00:00
David van Moolenbroek
241ebcae9b RMIB: expose full node path; improve restartability
A single function may be used to handle the implementation of more
than one node.  In some cases, the behavior of that function may
depend on the path name used to reach the node.  Therefore, provide
the full path name as part of the call information.

As a result, RMIB has to save the paths for each of its remote MIB
mount points.  That in turn also allows it to autonomously remount its
mount points after a MIB service restart, thus bringing us a step
closer to proper recovery after a MIB crash without requiring the
service using RMIB to perform explicit steps.  As before, the missing
ingredient is actual notification of MIB service restarts, and proper
support for *that* will likely require changes to the DS service.

Change-Id: Ic0c79931d6f3a76c2c998047f8b47350fd0fa5b0
2017-03-09 23:39:55 +00:00
David van Moolenbroek
bfa518c7ec PM/libsys: extend getepinfo, add getsockcred(3)
The service-only getepinfo(2) PM call returns information about a
given endpoint.  This patch extends that call so that it returns
enough information to allow correctly filling a sockcred structure.
A new getsockcred(3) function is added to libsys to fill an actual
sockcred structure with the obtained information.  However, for the
caller's convenience, the groups list is kept separate.

Change-Id: I9f1a6d1a221c77eabaa3498ff4ec9a5fb922e4fd
2017-03-09 23:39:55 +00:00
David van Moolenbroek
462713495a libsys: retire getnucred in favor of getepinfo
The getnucred() function was used by UDS to obtain credentials of user
processes in a form used in the UDS API, namely the ucred structure.
Since the NetBSD merge, this structure has changed drastically (aside
from being renamed to "uucred"), and it is no longer in UDS's best
interest to use this structure internally.  Therefore, getnucred() is
no longer a useful API either, and instead we directly use the
previously private getepinfo() function to obtain credentials.

Change-Id: I80bc809de716ec0a9b7497cb109d2f2708a629d5
2017-03-09 23:39:54 +00:00