homebridge-rpi icon indicating copy to clipboard operation
homebridge-rpi copied to clipboard

bad hostname validation

Open ilg opened this issue 3 years ago • 2 comments
trafficstars

It appears that rpi will not accept a hostname where any part of the FQDN begins with a digit, even though these are valid hostnames:

$ rpi -H 2example.com info
rpi: error: host: 2example.com: not a valid hostname or IPv4 address
$ rpi -H something.2example.com info
rpi: error: host: something.2example.com: not a valid hostname or IPv4 address

ilg avatar Jul 25 '22 01:07 ilg

Indeed, the original RFC 952 from 1985 didn’t allow a hostname to start with a number, but they changed that in RFC 1123 in 1989. I don’t remember where I got the specs, but clearly, I got the wrong one. This affects all hostname checks through OptionParser in homebridge-lib.

ebaauw avatar Jul 25 '22 04:07 ebaauw

Fixed in homebridge-lib v5.6.3. If you re-install Homebridge RPi, it should pick up this version.

ebaauw avatar Jul 31 '22 18:07 ebaauw