asb / raspi-config

Configuration tool for the Raspberry Pi. Now maintained at https://github.com/RPi-Distro/raspi-config
Other
263 stars 328 forks source link

System errors after changing to hostname with a space #34

Open G33kDude opened 10 years ago

G33kDude commented 10 years ago

When entering an invalid hostname (ie, with a space), it will save the invalid hostname to /etc/hosts, but remove the space (unsure about other characters) and save the changed hostname to /etc/hostname. This causes some funny errors, such as "sudo: unable to resolve host"

Any reason why it doesn't prevent you from entering invalid hostnames in the first place?

Stonie commented 10 years ago

The warning message is pretty clear: https://github.com/asb/raspi-config/blob/master/raspi-config#L204

But we could probably add some validation...

G33kDude commented 10 years ago

I'm aware of the warning message, but I entered the space without really thinking about it. The large problem is it wouldn't change back after. I had to manually go in and fix the file.

Stonie commented 10 years ago

Fair point and I bet you are not the only one. I will have a look when I get a moment.