tech-userlevel archive

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

Re: [CODE] inetd



Le Mon, Jun 19, 2023 at 07:34:43PM +0200, tlaronde%polynum.com@localhost a écrit :
> The new version of inetd is here:
> 
> http://downloads.kergis.com/misc/inetd.tar.gz
> 
> I have rewritten the majority of the parsing code, and put everything
> in parse.c, with a lot of comments---there is no more parse_v2.c since
> with two different files, for the same thing, things were not parsed
> exactly the same way.
> 
>[...] 
> There is one thing I have dropped and I need feedback about it:
> separating statements with semicolon in new syntax.
> 
> This allows "to put several service definitions on the same line" and
> even to put a legacy positional service definition after v2 ones.
> 
> It seems to me to be absolutely useless. Continuation lines allow to
> clarify things by shortening the lines. The semicolon allows to lengthen
> them, with absolutely no reason (if root wants to "obfuscate" its
> config file he can change the reading permissions bits...).
> 
> So is it used? Have I to support this---or can I simply support it
> (silently) at the end of a v2 syntax statement (for backward
> compatibility), and error if something is put after?

Well at least it is used in src/tests/usr.sbin/inetd/

So I will support the trailing ';' for service definition---even if this
creates corner cases if another entry is put in the same line: is
';[[:blank:]]*\.<directive>' valid? I will go for yes. That is with
';' the following initial blanks are ignored and this is as if the stmt
was starting at the very first char of a line---the problem is with
continuation lines that are defined by a leading blank, while escape
sequences are supported and a backslash before eol would have been
a simpler way to define continuation lines for directives or srv
definitions...

Other devil in the details: escaping is done only in quoted sections
in the present src/ code.
While, all in all, quoting should have meant "as is" (there is no
difference between single and double quotes), except for an escaped
quote inside quotes, and escaped sequence should be allowed in
value definition (not keyword) outside quotes (this is what I have
implemented now; so it is compatible with previous but an
extension---and it is valid for legacy syntax as well)...
-- 
        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