tech-userlevel archive

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

[CODE] inetd(8)



You will find here:

http://downloads.kergis.com/misc/inetd.tar.gz

the sources for implementation of what I had proposed for inetd(8):

- Create a checker mode;
- Never serve a not valid config;
- Resilient mode;
- Fallback feature;
- Restate the syntax (there are extensions to bypass things I find
unfortunate; example: instead of overloading comment with '#@' just
add a ".ipsec" directive; as well add a ".defhost" directives instead
of acrobatics about "host:" on a line by itself---these are still
supported but a warning is emitted to encourage to use the new
directives).
- Publish a validated config via syslog or on stdout (if requested in
checker mode with the -d flag);
- The exit status is one of sysexits(3).

I have untangled things and totally rewritten the scanning and parsing:
parse_v2.c doesn't exist anymore, but since I needed to publish back
the config, I developped a String Auxiliary Processor i.e. a... SAP!
and it is put aside because it could be more widly useful.

The SAP deserves more explanations and I will send a separate message
about it later.

The result adds only 1ko to the executable.

The syntax is compatible with the existing except for one thing: I make
a difference between single quotes and double quotes: a sequence
between single quotes is taken "as is"---like in sh(1); between
double quotes, escape sequences are interpreted.

Extensions:
	- I cover the whole escaping club and added octals---but for
the moment this is compatible with printf(1) but this is unfortunate
because \777 is a valid octal... \oDDD imposing three digits would be
better;
	- The escape sequences are allowed anywhere, and not only inside
quoted sequences, when a value is expected;
	- I have added three directives: ".ipsec", ".defhost" and
".grestore", the latter being a flag instructing to reset defhost and
ipsec to the values they had before the inclusion of the file (this for
compatibility with previous implementation).

The ".include" now works as in the shell: it is the same as if the
lines had been directly written in the config file with the exception of
continuating lines: a statement starting in one file must end in the
very same file.

I have added the essentials in the man page but it needs more
attention.

The program compiles and runs but it needs a complete bunch of tests
(there are corner cases in the syntax and the rate_limit and ipsec
stuff have been only superficially touched; as well as the accept filter
with a comment, in the original sources, still saying it needed to be
verified that the filters still worked...).
-- 
        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