Bug #2344
open
Disallow dots in vm names
Description
I had a user create a host with dots in the name, which appeared to auto-create the sub-domain in Foreman.
The problem is that the domain was not added to the location or organization after it was created, so every time he tried to edit the host he got a 'Host Not Found' error after a long delay.
The logs showed:
not found: Couldn't find Domain with ID=351 [WHERE (domains.id in (SELECT taxable_id from taxable_taxonomies WHERE taxable_type = 'Domain' AND taxonomy_id in (1) ) ) AND (domains.id in (SELECT taxable_id from taxable_taxonomies WHERE taxable_type = 'Domain' AND taxonomy_id in (81) ) )]
Rendered home/_topbar.rhtml (3.3ms)
Rendered common/404.rhtml within layouts/application (8.7ms)
Completed 404 Not Found in 15969ms (Views: 9.5ms | ActiveRecord: 23.7ms)
There is also the issue that if I add the domains and the proper delegations in named I now have to worry about deleting the existing A records and adding them to the new zones I create in named, where they would belong.
It seems it would be better, for the sake of not causing odd problems, to (at least optionally) disable auto creation of new domains, and disallow dots in names, unless it can be made to work more seemlessly, without opening it up to the possibility of abuse (user specifying a hostname in a domain that already exists, but not in the location or organization, and therefore getting it pulled over for use where it was not intended).