[avahi] Re: Avahi daemon dies on certain hostnames

Lennart Poettering lennart at poettering.net
Sat Apr 1 04:20:48 PST 2006


On Sat, 01.04.06 10:27, Ross Burton (ross at burtonini.com) wrote:

> On Sat, 2006-04-01 at 03:06 +0200, Lennart Poettering wrote:
> > The problem is not with host names that are proper UTF8 names. Those
> > are supported properly right now. The problem appears with host names
> > that contain characters that are not valid in UTF8. Avahi doesn't
> > check for this right now, but the IPC system we use (DBUS) does and
> > runs amok.
> 
> How about returning the valid portion of the string, whilst logging the
> failure to syslog?  Incomplete hostnames will alert the user that
> something is up, and syslog will tell them the problem (log an ASCII
> representation of the byte sequence and the offset to the invalid
> character).

This is actually not as simple as it sounds. If we sanitize a host
name in the way you described, this would not be an invertible
function. However, we need it to be a bijective function. Just think
of the following situation: Avahi finds a service with an invalid UTF8
name. it sanitizes it and passes it to the application which was
browsing for it. Now that app wants to resolve it, hence it sends the
sanitized string back to Avahi. To resolve it Avahi needs to remap
this sanitized string back to the original, invalid string. If the
sanitation function isn't invertible this is not possible, at least
not without ugly kludges to deal with collisions.

Due to the size limitation of DNS labels we cannot expand the length
in that sanitation function if we want to keep bijectiveness. Hence
we cannot use character escaping for invalid characters. Hence I would
say that there is no bijective function that would fulfill the
sanitation purpose.

In short: all we can do is ignore the invalid RRs and log something
about this fact.

If I understood correctly the Axis cameras don't come with invalid
host names by default, correct? This was a bad manual configuration,
right? If so, I don't see such a big problem if we simple refuse to
work with badly configured devices. 

This whole issue is something that should be fixed in the Axis
cameras and not by Avahi. 

Lennart

-- 
Lennart Poettering; lennart [at] poettering [dot] net
ICQ# 11060553; GPG 0x1A015CC4; http://0pointer.net/lennart/


More information about the avahi mailing list