Project

General

Profile

Actions

Bug #8807

open

root password handling is broken

Added by Ohad Levy about 10 years ago. Updated almost 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Host creation
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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 :)


Related issues 1 (0 open1 closed)

Related to Foreman - Bug #8739: default root_pass not used if password field is an empty stringClosedDominic Cleal12/17/2014Actions
Actions

Also available in: Atom PDF