Commit Graph

198 Commits

Author SHA1 Message Date
benno e798b91840 getifaddrs() can return entries where ifa_addr is NULL. Check for this
before accessing anything in ifa_addr.
ok claudio@
2020-12-30 18:41:06 +00:00
schwarze c9d6433d50 briefly mention /etc/examples/ in the FILES section of all the
manual pages that document the corresponding configuration files;
OK jmc@, and general direction discussed with many
2020-02-10 13:18:20 +00:00
deraadt df69c215c7 When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.
2019-06-28 13:32:41 +00:00
florian 18d15a648c struct sockaddr_storage is guaranteed to be large enough, no need to check
the size.
OK kn, deraadt
2018-10-15 11:29:27 +00:00
guenther f414793931 Use <fcntl.h> instead of <sys/file.h> for open() and friends.
Delete a bunch of unnecessary #includes and sort to match style(9)
while doing the above cleanup.

ok deraadt@ krw@
2018-04-26 12:42:50 +00:00
jca 276bf740fc Fix pledge(2) usage
We should not try to tighten pledge promises in the master inetd
process, since those are needed to reload the configuration.  Only
tighten down if 1) we have forked 2) we're running one of the builtin
routines, which are dealing with network input.

Pointed out by and ok benno@
2017-10-04 23:56:48 +00:00
jca 53213b25b8 Don't try to handle IPv4-compatible IPv6 addresses
ok florian@ millert@
2017-10-04 20:15:52 +00:00
jca c9d10ebe31 inetd actually supports stream and datagram sockets only
ok deraadt@
2017-10-04 19:52:26 +00:00
benno 942ef79866 inetd needs cpath pledge to unlink unix socket at program termination.
From Anthony Coulter - thanks!
ok jca@
2017-10-04 18:08:26 +00:00
tedu 9e23c5a985 remove lint comments 2016-08-25 05:23:19 +00:00
jmc faa33665ab for some time now mandoc has not required MLINKS to function
correctly - logically complete that now by removing MLINKS from base;

authors need only to ensure there is an entry in NAME for any function/
util being added. MLINKS will still work, and remain for perl to ease
upgrades;

ok nicm (curses) bcook (ssl)
ok schwarze, who provided a lot of feedback and assistance
ok tb natano jung
2016-03-30 06:38:40 +00:00
mestre 4c67a02ce5 Remove a (now) obsolete comment about shortened IPv4 syntax
OK deraadt@ jca@
2016-03-16 20:16:39 +00:00
mestre 3c0f199211 Replace strncpy(3) calls for safer strlcpy(3)
OK deraadt@ jca@
2016-03-16 20:15:15 +00:00
mestre 2eba59a5c7 Replace atoi(3) calls for safer strtonum(3)
OK deeradt@ jca@
2016-03-16 20:09:58 +00:00
mmcc 626fd955e6 remove a NULL-check before free() 2015-12-22 19:44:01 +00:00
jmc e488283d8a these files document their config files too: adjust NAME accordingly;
ok schwarze
2015-11-14 01:22:04 +00:00
deraadt b1e9a47392 needs pledge "cpath" to allow unlink of AF_UNIX sockets eventually 2015-11-01 19:59:28 +00:00
deraadt 4359013679 inetd needs pledge "unix" to bind AF_UNIX sockets 2015-11-01 00:31:18 +00:00
deraadt 362920ef3c pledge "abort" left behind accidentally 2015-10-22 12:34:25 +00:00
jca d4cb28ceff optarg and optind are declared by unistd.h 2015-10-19 11:52:51 +00:00
jca 2448817a8f Add err.h, missing after pledge() introduction. 2015-10-19 11:51:17 +00:00
jca 24ecfc683a Make use of pledge(2); initial diff from deraadt@
As Theo says, there's probably room for stricter pledge requests, but
this would involve refactoring.
2015-10-18 16:11:19 +00:00
deraadt ded2548f1c actually, it uses getaddrinfo 2015-10-18 15:28:03 +00:00
schwarze e34c05504d reduce .Nd to one line and kill .Tn while here 2015-09-10 15:16:43 +00:00
deraadt b9fc9a728f Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)
2015-01-16 06:39:28 +00:00
dlg 8d1bc828ab replace the use of select and hand rolled deferral of signal handling
with libevent.

this has been in snaps for a while without any negative (or positive)
feedback.

review and tweaks by bluhm@ nicm@
ok bluhm@ deraadt@
2014-10-29 03:33:14 +00:00
dlg c686248187 jmc@ told me i broke the documentation. inetd doesnt write a pidfile so
we shouldnt say it does.
2014-10-13 01:56:44 +00:00
dlg 2f2695c65f dont need to store the same debug flag in two separate variables.
ok millert@ deraadt@
2014-10-13 01:53:14 +00:00
dlg d0ca4f7416 ansi function declarations.
ok gcc+sha256
2014-10-12 09:36:42 +00:00
dlg b3815cd84d cut out writing a pidfile. rc.d doesnt rely on it, and nor should you.
both bcook@ and schwartz@ suggested removing the pidfil unlink and path
ok sthen@ schwartz@
2014-10-12 08:55:25 +00:00
lteo a31c5aa33f Convert malloc/memset to calloc, and remove pointless casts while here.
From Benjamin Baier.
2014-06-17 03:12:37 +00:00
jmc fd49663c75 remove references to rshd; 2014-04-18 22:04:54 +00:00
deraadt af5650ac29 obvious unsigned char casts for ctype 2013-11-23 17:24:29 +00:00
deraadt 3e37b709e8 missing protos 2013-11-12 19:44:44 +00:00
deraadt 382358551f for datagrams, assume other protocols should fail
ok millert
2013-04-19 18:03:16 +00:00
deraadt 62e3c25282 handle ECONNABORTED errors from accept(). In many code blocks they can be
ignored silently and without aborting, much like EINTR and EWOULDBLOCK are.
ok's from various maintainers of these directories...
2013-03-11 17:40:09 +00:00
gsoares f95242c2ac small cleanup(%hd -> %d)
yes deraadt@
2012-04-19 14:33:24 +00:00
dlg 3c4281b152 clean up some newly created lies now that tftpd doesnt run out of inetd.
poke by deraadt@
2012-03-06 01:25:46 +00:00
sobrado b9e0f9e667 replace a few remaining UNIX terms with .Ux macros; this diff
completes the changes from Oct 22.
2009-12-29 10:25:43 +00:00
otto 51a9e7d759 we have closefrom(2), so use it; ok deraadt@ tedu@ 2009-11-02 20:03:01 +00:00
deraadt 043fbe51c1 rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms
2009-10-27 23:59:19 +00:00
claudio 1b830f879d Do not use __progname in inetd as it is not portable. Instead hardcode it to
"inetd" in the few locations that print out the program name.
requested and OK deraadt@
2008-07-28 15:42:07 +00:00
claudio 2c4a6bc86b Use __progname instead of hand rolled version using argv[0].
Diff from Gleydson Soares gsoares at gmail dot com
OK millert@
2008-07-27 10:06:10 +00:00
sobrado 4463de31c1 add an underscore to argument name. 2008-06-28 10:54:45 +00:00
miod ffce9674b3 adderss -> address 2008-06-04 18:11:34 +00:00
espie 3ca821ab96 validate argv, okay otto@, henning@ 2008-01-25 13:52:20 +00:00
jmc e7a08e4a39 remove out of date/irrelevant section of BUGS dealing with ip6;
ok deraadt
2008-01-06 16:04:34 +00:00
jmc 91107b6999 - document what happens when a service exceeds its max spawn rate. this is
based on a diff from reed@netbsd, but i chose a different fix
- whilst here, make the descriptions of -R and .max more consistent

ok sthen sobrado(in part, at least)
2008-01-06 13:49:42 +00:00
jmc 844173ee7c sync usage() w/ SYNOPSIS; 2008-01-05 09:53:42 +00:00
gilles 673a9bc797 use strcspn to properly overwrite '\n' in fgets returned buffer
ok pyr@, ray@, millert@, moritz@, chl@
2007-09-11 16:30:59 +00:00