Bug #26640
closedRegistering a host with the same hostname as another host unregisters the original host
Description
Description of problem:
Let us have systems System1, System2.
When we register System1 to the Satellite and then set the same hostname to System2 as System1 has and register System2, System2 gets registered and System1 is removed from Satellite. The System2 content host has the same id as the original System1 content host but it has System2's UUID.
This happens regardless of if we register through login/password or activation key.
Note only locally set hostname is taken into acount. Anyone can set it. This results to the fact that anyone who is able to register is also able to unregister any other host.
How reproducible:
Deterministic
Steps to Reproduce:
1. system1# hostname
system-1-hostname.localdomain
2. system1# subscription-manager register --org Default_Organization --activationkey ak
[...]
The system has been registered with ID: <UUID1>
[...]
3. Open the content host page, note ID (in URL), note UUID
4. system2# hostnameclt set-hostname system-1-hostname.localdomain
5. system2# subscription-manager register --org Default_Organization --activationkey ak
[...]
The system has been registered with ID: <UUID2>
[...]
6. system1# subscription-manager status
Consumer profile "<UUID>" has been deleted from the server. You can use command clean or unregister to remove local profile.
7. In WebUI, refresh the content host page. Note the content host with same ID has UUID=<UUID2>.
Actual results:
System1 got unregistered. Anyone who can register can also unregister any system registered to the Satellite.
Expected results:
Another content host should have been created.