ebaauw / homebridge-rpi

Homebridge plugin for Raspberry Pi.
Apache License 2.0
311 stars 19 forks source link

bad hostname validation #134

Closed ilg closed 2 years ago

ilg commented 2 years ago

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
ebaauw commented 2 years ago

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 commented 2 years ago

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