In my previous message, I meant to explicitly say that I'd just
change exports(5) to remove the couple of examples that use dotted-quads
with less than 3 dots.

If that's not considered approprite, then rather than reverting the
change to getaddrinfo(), change get_net() in usr.sin/moountd/moountd.c
to explicitly check for strings of digits and dots, and skip
calling getaddrinfo() in that case, judt doing the inet_network()
(and inet_makeaddr()) path instead.

It used to be that getaddrinfo() would tyically fail (one hoped) when
given a "name" like 1.2.3 (that is, it was hoped we wold not find that
in the DNS, and it failed to convert as a dotted quad, because of
insufficient fields).   The code in mountd then falls through and uses
inet_network() which (being ancient) accepts all the old crappy formats.

Now getaddrinfo() is no longer failing, but is (as it should, if they should
be interpreted at all) treating the dotted-"less than quad" in the old form
for an IP address (where 10.2 meant 10.0.0.2), which isn't what mountd
was expecting at all (it assumes getaddrinfo() will fail in such a case).

I'm not 100% sure what the getaddrinfo() is doing there at all ... it only
gets called when the first char of the "name" is a digit (what's special
about that case??) so most likely it is not really anticipating being called
with a host name, or FQDN, but only with an IP address.   Oh, I see  this
is the way IPv6 addresse literals are being handled .. if they happen to
start with a digit (2001:... but not c001:...) - ones that start with a
hex digit that is not a digit are handled later.

This whole section of code (get_net() in mountd) needs consigning to
/dev/null and being replaced by something sane.

kre

Reply via email to