NetBSD/etc/mtree
christos 2557380693 Inetd enhancements by James Browning, Gabe Coffland, Alex Gavin, Solomon Ritzow
Described in:
    https://www.mail-archive.com/tech-userlevel@netbsd.org/msg03114.html
And developed in:
    https://github.com/ritzow/src/pull/1

From their notes:

All new functionality should be explained by the updated manpage.

The manpage has been refactored a bit: A new section "Directives"
has been added and the information about default hostnames and
IPsec directives has been moved there, and the new file include
directive information is also there.

getconfigent has the most major changes. A newline is no longer
read immediately, but is called only by a "goto more" (inside an
if(false) block). This allows multiple definitions or directives
to exist on a single line for anything that doesn't terminate using
a newline. This means a key-values service definition can be followed
by another key-values service definition, a positional definition,
or an ipsec, hostname, or .include directive on the same line.

memset is no longer used explicitly to clear the servtab structure,
a function init_servtab() is used instead, which uses a C struct
initializer.

The servtab se_group field is its own allocation now, and not just
a pointer into the user:group string.

Refactored some stuff out of getconfigent to separate functions
for use by parse_v2.c. These functions in inetd.c are named with
the form parse_*()

parse_v2.c only has code for parsing a key-values service definition
into a provided servtab. It should not have anything that affects
global state other than line and line_number.

Some function prototypes, structures, and #defines have been moved
from inetd.c to inetd.h.

The function config_root replaces config as the function called on
a config file load/reload. The code removed from the end of
config(void) is now called in config_root, so it is not run on each
recursive config call.

setconfig(void) was removed and its code added into config_root
because that is the only place it is called, and redundant checks
for non-null globals were removed because they are always freed by
endconfig. The fseek code was also removed because the config files
are always closed by endconfig.

Rate limiting code was updated to add a per-service per-IP rate
limiting form. Some of that code was refactored out of other places
into functions with names in the form rl_*()

We have not added any of the license or version information to the
new files parse_v2.c, parse_v2.h, and inetd.h and we have not
updated the license or version info for inetd.c.

Security related:

The behavior when reading invalid IPsec strings has changed. Inetd
no longer exits, it quits reading the current config file instead.
Could this impact program security?

We have not checked for memory leaks. Solomon tried to use dmalloc
without success. getconfigent seemed to have a memory leak at each
"goto more". It seems like inetd has never free'd allocated strings
when throwing away erroneous service definitions during parsing
(i.e. when "goto more" is called when parsing fields). OpenBSD's
version calls freeconfig on "goto more"
(c5eae130d6/usr.sbin/inetd/inetd.c (L1049))
but NetBSD only calls it when service definitions are no longer
needed. This has been fixed. freeconfig is called immediately before
any "goto more". There shouldn't be any time when a servtab is in
an invalid state where freeconfig would break.
2021-08-29 09:54:18 +00:00
..
Makefile Handle mipsn64 2021-04-25 23:40:51 +00:00
NetBSD.compat.aarch64 separate out the arch-specific and compat-specific subdirs. 2019-02-09 21:43:23 +00:00
NetBSD.compat.mips64 ensure that all include dirs are created before make includes runs. 2019-02-17 05:29:08 +00:00
NetBSD.compat.powerpc64 separate out the arch-specific and compat-specific subdirs. 2019-02-09 21:43:23 +00:00
NetBSD.compat.riscv64 separate out the arch-specific and compat-specific subdirs. 2019-02-09 21:43:23 +00:00
NetBSD.compat.sparc64 separate out the arch-specific and compat-specific subdirs. 2019-02-09 21:43:23 +00:00
NetBSD.compat.x86_64 separate out the arch-specific and compat-specific subdirs. 2019-02-09 21:43:23 +00:00
NetBSD.dist.Xorg update for libX11 1.7.0. 2021-04-27 06:51:49 +00:00
NetBSD.dist.arm add all the arm subdirs explicitly. the mtree vs dist strikes again. 2019-07-09 22:23:48 +00:00
NetBSD.dist.base install experimental/* and ext/opt_random.h. they're expected to 2021-08-16 06:56:20 +00:00
NetBSD.dist.compat.in Rework this to auto generate the compat directories using a template 2015-06-19 18:16:06 +00:00
NetBSD.dist.dtb Separate devicetree .dts -> .dtb building from kernel builds. They are now 2020-05-18 21:19:34 +00:00
NetBSD.dist.dtrace Handle the contents of /usr/lib/dtrace so a MKDTRACE=yes release completes. 2015-10-09 19:23:18 +00:00
NetBSD.dist.evbmips merge the rest of sbmips into evbmips. install the stand files in 2017-08-15 10:11:31 +00:00
NetBSD.dist.i386 remove the recently added files or added entries for what is 2019-03-12 10:07:49 +00:00
NetBSD.dist.iscsi move ./usr/include/dev/iscsi into NetBSD.dist.iscsi that is only 2019-02-09 02:04:19 +00:00
NetBSD.dist.m68k separate out the arch-specific and compat-specific subdirs. 2019-02-09 21:43:23 +00:00
NetBSD.dist.mips ensure that all include dirs are created before make includes runs. 2019-02-17 05:29:08 +00:00
NetBSD.dist.powerpc remove the recently added files or added entries for what is 2019-03-12 10:07:49 +00:00
NetBSD.dist.sh3 ensure that all include dirs are created before make includes runs. 2019-02-17 05:29:08 +00:00
NetBSD.dist.sparc remove the recently added files or added entries for what is 2019-03-12 10:07:49 +00:00
NetBSD.dist.sparc64 Fix previous. 2019-04-03 19:52:38 +00:00
NetBSD.dist.sun2 remove the recently added files or added entries for what is 2019-03-12 10:07:49 +00:00
NetBSD.dist.sun3 remove the recently added files or added entries for what is 2019-03-12 10:07:49 +00:00
NetBSD.dist.tests Inetd enhancements by James Browning, Gabe Coffland, Alex Gavin, Solomon Ritzow 2021-08-29 09:54:18 +00:00
NetBSD.dist.x86_64 remove the recently added files or added entries for what is 2019-03-12 10:07:49 +00:00
NetBSD.dist.xcompat.in Support building the xorg X11 libraries under MKCOMPAT. 2015-06-24 22:20:24 +00:00
mkcompat.awk Rework this to auto generate the compat directories using a template 2015-06-19 18:16:06 +00:00
mkcompattree.awk Rework this to auto generate the compat directories using a template 2015-06-19 18:16:06 +00:00
special Add /etc/ip6addrctl.conf as optional file so it is backed up. 2021-02-26 18:39:10 +00:00