Bug #8807
openroot password handling is broken
Description
while trying to set root password on a hostgroup and a host, i was unable to properly use a hostgroup based root_pass hash.
one potential issue is the following code block (from https://github.com/theforeman/foreman/blob/develop/app/models/concerns/host_common.rb#L109)
unencrypted_pass = if kind_of?(Hostgroup) read_attribute(:root_pass) else root_pass end
since root_pass will always return value (as its either the host specific pass or the parent hostgroup pass), this has a potential side effect of creating a new hash, based on the parent hash, therefor disconnecting the host root_password (without the ability to reconnect in the ui).
steps to reproduce:
1. set a hostgroup password.
2. create a new host without a root password but associated to the hostgroup from step 1.
notice that host has a root password value in its db record.
warning, there might be other issues :)
Updated by Dominic Cleal almost 10 years ago
- Related to Bug #8739: default root_pass not used if password field is an empty string added
Updated by Dominic Cleal almost 10 years ago
- Category set to Host creation
The behaviour of copying the password into the host was deliberate in my change, just because that's how it's always worked in my experience (similar to other host group attributes on host creation). The method should detect that it's already crypted and not recrypt it at least.