tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: inetd(8): continue or exit on error?



Le Mon, May 29, 2023 at 11:43:33AM +0100, David Brownlee a écrit :
> On Mon, 29 May 2023 at 11:38, Michael van Elst <mlelstv%serpens.de@localhost> wrote:
> >
> > tlaronde%polynum.com@localhost writes:
> >
> > >If inetd is not running, if the administrator doesn't look at the logs,
> >
> > That's why people monitor services and logs and use manual or
> > automated procedures to validate and deploy configuration changes.
> 
> I have a slight preference towards 'exit on error', but both options
> have completely valid use cases.
> Could add a command line flag to determine whether to exit on error.
> Is there any prior art in other BSDs/Linux?
> One aspect to bear in mind is that inetd has been around ~forever, and
> conventions have changed over time.
> 
> > >At least, wouldn't it be worth to add a flag simply to parse and
> > >validate the syntax without running the daemon?
> >
> > It's always a good thing to be able to validate a configuration.
> 
> This absolutely sounds like a nice idea - could then be chained in
> rc.d so 'inetd reload' could check the file and abort with an error
> rather than reloading (similar to the recent sshd changes)
> 

So seems others are OK at least for the checking without running (that
seems to me the bare minimum to provide due to the complexity of the
thing and the security implications).

But I will once more plead for exit on error due to this feature (from
the man page):

---8<---
To avoid the need to repeat listen addresses over and over again, listen
addresses are inherited from line to line, and the listen address
can be changed without defining a service by including a line containing
just a listen-addr followed by a colon.
--->8---

If one such line fails, all that will be parsed after (necessarily from
another file) will potentially not listen where it should!

Imagine what it can be if telnet is listening on 22!

(One solution: clear the definition of the default address defhost when
including another file.)

I'm for: exit on any error. If we provide a way to check, that's the
responsability of the administrator to check his config before trying to
run the thing.

I will also modify the man page, because including several times the
same config files has not an undefined behavior (well, at the moment:
yes, but only because of a blunder in the code): the file is only
included once; every other appearance is skipped (it doesn't really work
at the moment due to the bugs).

Thing that I will not do now but could be done: when globbing is used
and this results in several files, since the order of inclusion is
random, verify that the files are orthogonal and exit with error if they
are not.
-- 
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                     http://www.kergis.com/
                    http://kertex.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C


Home | Main Index | Thread Index | Old Index