#1128058 auto-apt-proxy: SRV lookup of illegal service name

#1128058#5
Date:
2026-02-15 12:52:56 UTC
From:
To:
I reported this originally in bug #1051481
"apt-cacher-ng: Illegal SRV name (underscore not valid except first character of label)"
in September 2023 and it was fixed in f9330e88 2024-07-17.

At that time it seems I forgot to also report it for auto-apt-proxy!

Got bitten by it again now whilst writing an extension that uses
systemd-resolved/resolvectl instead of avahi-browse to do the lookup.

Specifically, systemd-resolved correctly refuses to advertise the
illegal SRV name so look-ups were failing 'mysteriously'.

systemd-resolved[1424470]: /etc/systemd/dnssd/squid-deb-proxy.dnssd:3: Service type is invalid. Ignoring.

$ cat /etc/systemd/dnssd/squid-deb-proxy.dnssd
[Service]
Name=Squid deb proxy on %H systemd
Type=_apt_proxy._tcp
Port=8000

The definition is in RFC6335 section 5.1 "Service Name Syntax":

Valid service names are hereby normatively defined as follows:

   o  MUST be at least 1 character and no more than 15 characters long

   o  MUST contain only US-ASCII [ANSI.X3.4-1986] letters 'A' - 'Z' and
      'a' - 'z', digits '0' - '9', and hyphens ('-', ASCII 0x2D or
      decimal 45)

   o  MUST contain at least one letter ('A' - 'Z' or 'a' - 'z')

   o  MUST NOT begin or end with a hyphen

   o  hyphens MUST NOT be adjacent to other hyphens